Results 1 to 2 of 2

Thread: question about vertical-align in this specific case

  1. #1
    Join Date
    Jun 2007
    Posts
    64
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Red face question about vertical-align in this specific case

    hi there...

    i have found this article on the net:
    http://stackoverflow.com/questions/2...-list-or-a-div

    as you can see they work with line-height and vertical-align to vertically center an image inside ul/li tags in a div... now this works cool, but.....

    if you also have an a(link)-tag before the image, not only the image (exact border) is a hyperlink, instead the whole line-height area is the link..
    now what i need is a vertical-center but the link should be wraped exactly around the img tag and not for the whole line-height defined space...

    i hope you do understand what i mean!

    thx for any help !!!



    btw here is the css for my div (which is also centered to the middle of the page):

    Code:
    width: 100%;
     height: 400px;
     position: absolute;
     top: 50%;
     margin-top: -200px;
     white-space: nowrap;
     z-index: 1;
    this is the css for the ul/li

    Code:
    line-height: 400px;
    and thats the img inside ul/li

    Code:
    vertical-align: middle;

    plz help me!!!
    Last edited by kobo1d; 04-26-2010 at 11:16 AM.

  2. #2
    Join Date
    Mar 2010
    Posts
    28
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Smile

    The code seems to be working fine. Can you add the demo link to verify? there may be a chance of Overriding some css property by other class / ID.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •