【发布时间】:2013-10-20 13:57:47
【问题描述】:
我现在正在做一些事情,但这是行不通的!
基本上我要做的是在我的图像上放置一个黑色不透明的“屏幕”,这样它就不会那么亮,你可以阅读图像顶部的文字。
此处的示例:
这是我目前拥有的。
<div class="overlay">
<span class="front-coffee block"></span>
<p class="center">Coffee Shop</p>
</div>
div.overlay{background: black; z-index: 5; width:100%; height:100%;}
.block { display: block; }
div.popularCategory p{font-size: 24pt; color: white; margin-top:-50px}
span.front-coffee{background:url('../img/categories/coffee.jpg') no-repeat center; zoom:0.65; width:100%; height:100%; z-index: 4}
【问题讨论】:
-
尝试将宽度和高度(以像素为单位)设置为 100% 会在您的情况下返回其他内容,因为未指定父 div 的高度和宽度。
-
会的,等一下,我会回复你的!
-
无济于事,没用!但是,我用覆盖的类编辑了我的帖子。