【发布时间】:2013-12-28 19:12:42
【问题描述】:
我试图将一些文本叠加到我页面上的图像上。我知道代码必须在 css 中,但如果不扭曲和丢弃所有内容,我就无法让它工作。这是图像在我的 html 代码中的位置
<div id="current">
<h3><u>Current Products</u></h3>
<img id="nintendo" src="http://www.albany.edu/~jc191638/image/n641.jpg" alt="n64"/>
<span class="text">text text text...</span>
<p id="nintext">
</div>
这是它的css
#current
{
float:center:
height:984px;
width:600px;
background-color: #475F77;
padding-bottom:10px;
text-align:center;
border-style:solid;
border-color: #D74B4B;
}
#current:hover .text
{
display: block
}
.text
{
display: none;
position: absolute;
left: 0;
bottom: 0;
width:100%
background: #999;
background: rgba(0,0,0,0.3);
text-align: center
}
#nintendo
{
height:70%;
width:70%;
padding-left:10px;
}
【问题讨论】: