user1283674
user1283674

Reputation: 339

How to vertical align in a div?

I don't know how to align the text that is currently in the top left of the header so that it appears in the bottom. Any advise would be greatly appreciated:

This is how is appears at the moment:

enter image description here

This is how I want it to look:

enter image description here

This is code I have so far:

        <div id="header_container">
           <div id="subheader-left" style="float:left; width:50%; text-align:left">chilun liu</div>
              <div id="subheader-right" style="float:right; width:50%; text-align:right">
    <!-- the Social Network's images  -->  
              </div>         
           </div>
        </div>

Upvotes: 0

Views: 73

Answers (2)

Mohd Abdul Mujib
Mohd Abdul Mujib

Reputation: 13908

try,

#subheader-left { position: absolute; bottom: 0; left: 0; }

Upvotes: 1

NoobEditor
NoobEditor

Reputation: 15871

Add this to your existing css

#subheader-left,#subheader-right{
 display:table-cell;
 vertical-align:bottom
}

Side Note : This solution is supported IE8 and above...

Additionally

style="border:none; width="40" height="40"

should be

style="border:none; width:40px; height:40px"
                      /*  ^^ no "=" sign or quotes,instead, 
                         semi colon and values only */

Upvotes: 3

Related Questions