我的图片和图片之间的文字有问题。
这是我的照片:
我有一个文本:“主页”
我想把这个文本(“主页”)放在图片的中间。
并且还必须有反应。
最佳答案
<div class="box">
<div class="img"><img src="" /></div>
<div class="text">home page</div>
</div>
.box{position:relative;}
.img{position:relative; z-index:1;}
.text{position:absolute; z-index:2; top:50%; left:0px;}
根据你的要求左转
关于html - 在 CSS 中显示图像和响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25949040/