Skip to content Skip to sidebar Skip to footer

Align The Text To The Bottom Of The A Tag

How do I get the text to the bottom of the a tag which is inside the li. Here is my code

Solution 1:

You can use relative+absolute positioning.

#navigationulli{
    position: relative;
    display:inline-block;
    color:#fff;
    font:12px Verdana, Geneva, sans-serif;
    padding:025px;
    background:url(images/nav_img.jpg) no-repeat center top;
    width: 100px;
    height:50px;
}
#navigationullia{
    position: absolute;
    top: 30px;
    display:inline-block;
    color:#fff;
    font:12px Verdana, Geneva, sans-serif;
    text-decoration:none;
    height:50px;

}​

You can see demo here.

Solution 2:

Solution 3:

Maybe...

  • Don't set your 'a' elements 'height' explicitly
  • Set 'display' to 'block'
  • Add padding-top to your 'a' elements to push them down to where you need them

Post a Comment for "Align The Text To The Bottom Of The A Tag"