【发布时间】:2014-06-25 10:38:50
【问题描述】:
我试图在响应式 div 中垂直居中一些文本。我无法弄清楚。如果我能得到一些帮助,我将不胜感激。
谢谢。
<style>
.thumb {
float: left;
margin: 0px;
padding: 0px;
position:absolute;
height:100%;
width:100%;
}
.thumb img {
width: 100%;
padding: 0;
}
.thumb > div {
background-color: rgba(0,0,0,0.1);
opacity: 0;
position: absolute;
top:0;
bottom:0;
left:0;
right:0;
}
.thumb:hover > div {
display: block;
opacity: 1.0;
}
.thumb > div div {
}
#text {
vertical-align: middle;
position: relative;
z-index: 2;
display: inline-block;
}
</style>
【问题讨论】: