【发布时间】:2015-04-30 19:22:53
【问题描述】:
我的页面上有几个 div 框,我想让它们在您将鼠标悬停在它们上时显示文本。我正在查看一些教程,但我似乎无法让它与我的一起工作,这是我的一个盒子的一个例子。
html:
<div class="squar-1">
<div class="text-1">
<p>Hello</p>
</div>
</div>
CSS:
.squar-1 {
width: 50%;
height: 350px;
background-color: #e57373;
float: left;
}
.squar-1 .text-1 {
position:relative;
bottom:30px;
left:0px;
visibility:hidden;
}
.squar-1:hover .text {
visibility:visible;
}
【问题讨论】: