Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Solution to vertically position a ul list within a div and have it stay put.

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #33882
    pittles78
    Participant

    Hello,

    I need to figure out how to vertically center the

    #wrap ul li { list-style:none;
    padding: 2px;
    display:block;
    line-height: 5px;
    }

    to the ribbon on this page. Right now it sits pretty much in the vertical center in Firefox and Safari, because I have given a line height to bump it there, but I need the real answer so it’s positioned correctly in all browsers.

    Please view the page hear:

    http://pittsells.com/sample.htm

    Kind regards,
    Jon

    #84859
    OttoJuul
    Member

    I think i solved this at work, but unfotunately the code is at work I’ll look into it and return tomorrow if it is indeed the solution.

    #84866

    @Paulie_D Did you mean that you should set the line-height to the same value as the height? The font-size has nothing to do with it.


    @pittles78
    Try giving the list item a fixed height (rather than using padding) and then match the line-height to that value. That will be as consistent as you can get it cross-browser wise.

    #84871
    pittles78
    Participant

    Thanks again sl1dr! That was the answer I was looking for.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.