Results 1 to 5 of 5

Thread: problem with vertical text align

  1. #1
    Join Date
    Dec 2005
    Posts
    136

    problem with vertical text align

    I am trying to make a CSS navigation, I have managed to get it the way I want except for one thing, I cannot get the text to be vertically aligned, if i use padding in IE 7 it works fine , but in Firefox it sticks a bit extra background image on the bottom, I have tried to use the vertical-align but it does not work, here is the code I am using:

    HTML Code:

    <div id="Navigation">

    <ul>
    <li>Home</li>
    <li>Forums</li>
    <li>DKP</li>
    </ul>

    </div>

    CSS code:

    #Navigation {
    border-top: 1px solid #FFFFFF;
    width: 100%;
    height: 40px;
    background: url(Nav_Main_Background.bmp);
    padding: 0px;
    margin: 0px;
    }

    #Navigation UL {
    padding: 0px;
    height: 39px;
    margin: 0px;
    }

    #Navigation LI {
    padding-left: 30px;
    padding-right: 30px;
    padding-top: 10px;
    background: url(Nav_Background.bmp) right 0%;
    height: 29px;
    color: #FFFFFF;
    float: left;
    list-style-type: none;
    margin: 0px;

    }

    Please help me somebody.

  2. #2
    Join Date
    Dec 2007
    Posts
    1,599
    Start by making the div position:relative and the content position:absolute

  3. #3
    Join Date
    Jun 2006
    Posts
    623
    vertical-align applis to two cases:
    1. aligning relative to the text baseline within an inline element (I think this is what you were trying to describe above, but as block level elements don't go inside inline elements your description really doesn't make sense).
    2. aligning relative to the table row baseline within table cells.

    The second use may be of some help to you: apply the vertical-align property to the td not to the contained spans. Failing that apply padding and margin to achieve the layout you want.

    Or, considering that you've decided that this form is sufficiently table-like to be a table, why not use a nested table for the nested options?

  4. #4
    Join Date
    Dec 2007
    Posts
    1,736
    Please see this link here about Css vertical-align

  5. #5
    Join Date
    Dec 2005
    Posts
    136
    I put a overflow: hidden; in the UL and included the padding so when the background overflowed in FF it was hidden so this way I have solved the problem. Thanks anyways

Similar Threads

  1. How to align wd20ears to windows 7
    By KIdaa PaA in forum Hardware Peripherals
    Replies: 5
    Last Post: 24-02-2011, 07:15 PM
  2. vertical blue line on screen problem
    By Allanoo in forum Monitor & Video Cards
    Replies: 3
    Last Post: 02-09-2009, 09:12 PM
  3. How to Align text inserted in html table format
    By DarenHawk in forum Software Development
    Replies: 3
    Last Post: 11-08-2009, 09:08 AM
  4. Replies: 2
    Last Post: 30-06-2009, 11:34 PM

Tags for this Thread

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
  •  
Page generated in 1,717,389,836.11547 seconds with 16 queries