嗨,
目前文本位于我网站的顶部,但我希望它位于底部;
<p style="text-align:relative;">this is best day ever!this is best day ever!this is best day ever!<p>
当我编辑它并添加 text-align:bottom 时它会起作用!!!!
试试这个代码:
<html>
<head>
<title>test</title>
</head>
<body>
<div style="position: relative">
<p style="position: fixed; bottom: 0; width:100%; text-align: center"> TEXT YOU WANT
</p>
</div>
</body>
</html>
尝试这个:
style="position:absolute; bottom:0px;"
<p id="Bottom">this is best day ever!this is best day ever!this is best day ever!<p>
和 CSS :
#Bottom {
position : absolute;
bottom : 0;
}
p {
height:200px;
display: table-cell;
vertical-align: bottom;
}
这是一个更好的方法...
<html>
<head>
<title>test</title>
</head>
<body>
<div style="display: table;">
<p style="display: table-row;vertical-align: bottom; text-align: center"> TEXT YOU WANT
</p>
</div>
</body>
</html>
我在这个问题中找到http://stackoverflow.com/questions/526035/how-can-i-position-my-div-at-the-bottom-of-its-container/19110204#19110204
了Hashbrown
答案