7

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!!!!

theRadBrad
  • 125
  • 1
  • 3
  • 10

6 Answers6

16

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>
Ankit Chaudhary
  • 4,059
  • 1
  • 11
  • 23
Johnson Smith
  • 201
  • 1
  • 2
1
 <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;
}

Demo

Vaibhav Jain
  • 3,729
  • 3
  • 25
  • 42
0

Try this:

style="position:absolute; bottom:0px;"
Abhishek Jain
  • 2,597
  • 1
  • 18
  • 12
0

Absolutely position the element and set its bottom property to 0.

p{
    position: absolute;
    bottom: 0;
}

Working Example http://jsfiddle.net/zMKbf/

Kevin Bowersox
  • 93,289
  • 19
  • 159
  • 189
0
p {
    height:200px;
    display: table-cell;
    vertical-align: bottom;
}

This is a better way...

Salvio
  • 100
  • 2
  • 15
0
 <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

omer
  • 2,435
  • 2
  • 24
  • 28