0
我的大脑被炸,所以我需要你们帮忙。简单的垂直对齐问题div
我想在div中做垂直对齐。
我
HTML
<a href='#'>
<div class="div">
<div class="insideDiv">text here</div>
</div>
</a>
我的CSS
a {
color: #006699;
text-decoration: none;
font-size: 10pt;
border-width: 0;
position: relative
}
.div{
position: absolute;
background-color: red;
top: -75px;
left: 50px;
width: 100px;
height: 50px;
z-index: 1000;
padding: 8px;
}
.insideDiv{
background-color: white;
width: 100px;
height: 47px;
border: solid 1px grey;
font-weight: bold;
vertical-align: middle;
text-align: center;
}
好像text here
不能垂直对齐到中年,但水平对齐中心。任何人都可以帮我解决这个问题吗?非常感谢!
可能重复的[垂直对齐文本在Div](http://stackoverflow.com/questions/2939914/vertically-align-text-in-a-div) – lifetimes 2013-05-02 00:19:24
我认为,有'div'在'a'中给你错误,正好在wh3c – jhunlio 2013-05-02 00:32:54