【发布时间】:2017-01-20 12:35:42
【问题描述】:
我有这个代码
<div class="photo">
<img src="images.jpg">
<div class="text">Its transparent</div>
</div>
我试过这个css
.text{
opacity:0.8;
background-color:#ccc;
position:fixed;
width:100%;
height:100%;
top:0px;
left:0px;
z-index:1000;
}
还有这个
.text{
background: rgba(0, 0, 0, 0.28) none repeat scroll 0 0;
color: #fff;
position: relative;
top: -240px;
width:100%;
height:100%
}
我想在 images(不是背景)中使用透明背景的文字。我确实有一个透明的,但它没有覆盖整个图像。我已经尝试过了,但不适用于我。
Allow a div to cover the whole page instead of the area within the container
Background images: how to fill whole div if image is small and vice versa
【问题讨论】:
标签: css