Results 1 to 7 of 7

Thread: Vertical text align problem

  1. #1
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Vertical text align problem

    Hi,

    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;

    }

    Can anyone help me ?

    Scrooby

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Jeremy | jfein.net

  3. #3
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    No that does not work, wherever i put the vertical-align it does not work, i have tried to put it into the css page and the html page in a style tag but it never works, its like there is something over riding it or something blocking the text from moving down :S

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Where do you try putting the padding? In the ul, or the li?
    Jeremy | jfein.net

  5. #5
    Join Date
    Feb 2006
    Posts
    39
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    For what it's worth try this.
    I use includes and call this up.
    HTML
    <div id="leftnav">

    CSS
    /* *****************************************************
    Navigation Bar - Left hand side
    **************************************************** */
    #leftmenu {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    width: 160px;
    padding: 2px 5px 5px 5px;
    margin: 10px;
    float: left;
    display: block;
    }
    #leftmenu .heading {
    display: block;
    background-color: #6c9669;
    color: #ecf2eb;
    font-size: 90%;
    padding: 3px 0 5px 3px;
    border: 2px solid #2c5629;
    margin: 0px;
    width: 159px;
    font-weight: bold;
    }
    #leftmenu ul {
    list-style: none;
    margin: 0px;
    padding: 0px;
    border: none;
    }
    #leftmenu ul li {
    margin: 0px;
    padding: 0px;
    }
    #leftmenu ul li a {
    font-size: 80%;
    display: block;
    border-bottom: 1px dashed #416B1F;
    padding: 5px 0px 2px 4px;
    text-decoration: none;
    color: #666666;
    width: 160px;
    }
    #leftmenu ul li a:focus {
    color: #000000;
    background-color: #DDDFAE;/*lt olive green*/
    }
    #leftmenu ul li a:hover {
    color: #000000;
    background-color: #DDDFAE;
    }

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Jul 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Solved

    I have solved the problem, although it may not be the correct way of solving it.

    I put a overflow: hidden; in the UL and included the padding so when the background overflowed in FF it was hidden.

    Scrooby

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
  •