日期:2014-05-17  浏览次数:20621 次

DIV中的文字下居中怎么设置
各位大侠,大家好!
    如何让一个IDV中的文字下居中啊?即文字显示在DIV的最下面中间。
谢谢!
------解决方案--------------------
<!doctype html>
<html>
<style type="text/css">
#xy {text-align:center;width:200px;height:100px;line-height:30px;padding:0px;border:1px solid black;font-size:20px;}
#ab {position:relative;top:70px;}
</style>

<div id="xy"><div id="ab">dajiahao</div></div>
</html>
------解决方案--------------------
把文字放在另一个div中,控制该div的margin-top
<div id="div" style="width:100px; height:100px; border:1px solid #000;">
<div style="margin-top:82px;text-align: center;">
文字靠下居中
</div>
</div>