这是我的CSS:

.info {
    color: black;
    padding: 100px 15%;
}

.info img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.4;
    filter:alpha (opacity=40); /* For IE8*/
}

.info p {
    background: none repeat scroll 0 0 white;
    line-height: 1.5;
}

.info h3 {
    font-size: 36px;
    margin: 0;
}


这是我的HTML:

<div class="info" id="aboutus">
    <h3>About Us</h3>
    <img src="image/pink.jpg">
    <p>text</p>
</div>


我试图在图像上方显示文本,并在文本上添加阴影,但我被卡住了。

最佳答案

你是这个意思吗?


    关于我们
    文本
    http://www.skrenta.com/images/stackoverflow.jpg


的HTML

<div class="info" id="aboutus">
    <h3>About Us</h3>
    <p>text</p>
    <img src="image/pink.jpg" />
</div>


的CSS

.info img {
    opacity: 0.4;
    filter:alpha (opacity=40); /* For IE8*/
}

10-06 07:41
查看更多