我试图在正方形div内放置一些文本。唯一的问题是,它将文本转换成很大的div。有谁知道我可以如何让div回到原来的位置?添加文本时停止向下移动div
下面是HTML:
<div id="squarecontainer">
<div id="square1">
<p>Easy to Manage</p>
</div>
<div id="square2">
</div>
<div id="square3">
</div>
</div>
这里是CSS:
#squarecontainer{
text-align: center;
}
#square1{
display: inline-block;
position: relative;
margin-right: 100px;
height: 310px;
width: 310px;
margin-top: 72px;
background-color: #fff;
}
#square2{
display: inline-block;
position: relative;
height: 310px;
width: 310px;
margin-top: 72px;
background-color: #fff;
}
#square3{
display: inline-block;
position: relative;
margin-left: 100px;
height: 310px;
width: 310px;
margin-top: 72px;
background-color: #fff;
}
#square1
是真的转移远了,当我添加了 “易于管理” 的文字股利。
喜对不起,如果我真的不明白你的问题,你想实现你可以显示图片什么或做更加易于理解。如果posible .. – jhunlio 2013-03-05 06:11:21
顺便我做[小提琴](http://jsfiddle.net/jhunlio/RgywE/),但不能弄清楚什么问题。 – jhunlio 2013-03-05 06:14:01
我发现了下面的解决方案。添加verticle-align:top;把它移回去了。谢谢 – zachstarnes 2013-03-05 06:15:03