SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Css Navigation

  1. #1
    SitePoint Enthusiast turkey's Avatar
    Join Date
    May 2006
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Red face Css Navigation

    Hello,

    I am trying to build my first css controlled site . Anyways I am fairly new to this new to the building format (divs ect) but i understand what css does. Anyways i have a navigation menu with pipes. How do i get rid of the very first one to the left of the 'home' link?

    here is the site

    The border is set to the left which is causing it but i dont know how to specify it not to show up on the first link.

    Here is my CSS for that menu (it could probably be compressed a bit but im just doing it the way i know how):

    .navigation {
    background-image: url(images/menupattern.gif);
    background-repeat: repeat-x;
    height: 23px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #FFFFFF;
    margin-top: 0px;
    padding-top: 6px;
    text-align: center;
    padding-left: 150px;
    overflow: hidden;
    }

    #navlist
    {
    list-style-type: none;
    margin: 0;
    padding: 0;
    }

    #navlist li
    {
    float: left;
    line-height: 1em;
    border-left: 1px solid #fff;
    margin-left: -0.5em;
    padding-right: 0.5em;
    padding-left: 0.5em;
    margin-right: 0.5em;
    }

    #navlist li a:link {
    color: #ffffff;
    }

    #navlist li a:hover{
    color: #B7C6A8;
    }

    Thanks for your help!

  2. #2
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,116
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Hello,

    I would just give the first li element a class="first" and then remove the border from the element with that class.
    Also, you don't need both 'active' and 'current' id's - one is enough to style.

  3. #3
    SitePoint Enthusiast turkey's Avatar
    Join Date
    May 2006
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think im confused (or maybe its just really late) because the code navlist li is applying the code to the entire div so how could i seperate that one block? could you provide a quick example? i would greatly appretiate it.

  4. #4
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,116
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Sure,
    Code:
    <ul id="#navlist">
      <li class="first">No Border</li>
      <li>Border</li>
    </ul>
    Code:
    #navlist li {
    border-left: 1px solid #fff;
    }
    #navlist li.first {
     border-left: none;
    }
    Because the second selector is more specific - it will override the less specific styles.

    Hope it helps

  5. #5
    SitePoint Enthusiast turkey's Avatar
    Join Date
    May 2006
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oooooooooh! ok now that makes sense. I almost had it . Thank you very much for your help, it worked great!


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
  •