css:valign="bottom"在css里怎么写

来源:百度知道 编辑:UC知道 时间:2024/05/29 11:47:53
因为用td就可以用valign="bottom",但是页面代码全是div也不想加个表格进去,但是我的一个div高度是100,文字数不固定,2行间距设置为25px;我现在想有不管多少文字都是从底部对上面输出,先派满底部那一行,然后对上面递加,因为文字字数不固定用padding-top不行,
vertical-align:text-bottom; 这个似乎也是td里面 我试了也没有效果,不知道高手有没有别的方法
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
#txt{

height:300px;
width:300px;
border:1px solid #333333;
text-align:center;
position:relative

}
#txt p{
position:absolute;
bottom:0px;
padding:0px;
margin:0px
}
</style>
</head>

<body>
<div id=txt>
<p>aadsad</p>
</div>
</body>
</html>

这样就可以 希望能够有帮助的人用到!

在那个div里面插入一个<span class="xx">此处显示 class "xx" 的内容</span>
在css里面设置它的值
·xx{ line-height: 100px; color: #FF0000; }
差不多就这样吧