Reputation: 125
hi,
Currently the text is at the top of my website but i want it bottom;
<p style="text-align:relative;">this is best day ever!this is best day ever!this is best day ever!<p>
when i edit it and add text-align:bottom it dosent works!!!!
Upvotes: 7
Views: 85006
Reputation: 2621
<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>
i found it in this question, http://stackoverflow.com/questions/526035/how-can-i-position-my-div-at-the-bottom-of-its-container/19110204#19110204
in Hashbrown
answer
Upvotes: 0
Reputation: 100
p {
height:200px;
display: table-cell;
vertical-align: bottom;
}
This is a better way...
Upvotes: 0
Reputation: 201
Try this code :
<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>
Upvotes: 16
Reputation: 3755
<p id="Bottom">this is best day ever!this is best day ever!this is best day ever!<p>
and CSS :
#Bottom {
position : absolute;
bottom : 0;
}
Upvotes: 1
Reputation: 94499
Absolutely position the element and set its bottom property to 0.
p{
position: absolute;
bottom: 0;
}
Working Example http://jsfiddle.net/zMKbf/
Upvotes: 0