www.webdeveloper.com
Results 1 to 3 of 3

Thread: Please help, working on inline nav bar

  1. #1
    Join Date
    Jun 2013
    Posts
    3

    Please help, working on inline nav bar

    Hello,

    Will you please look at my code and tell me what I am doing wrong? I have added padding to my inline nav bar, but I cant get the background color in active and hover states to bleed over into that padded area. Any help is greatly appreciated!! Code below:

    <nav>
    <ul>
    <li id="active"><a href="index.html" id="">Home</a></li>
    <li><a href="#">About</a></li>
    <li><a href="#">Custom Homes</a></li>
    <li><a href="#">Remodels</a></li>
    <li><a href="#">Photo Gallery</a></li>
    <li><a href="#">Testimonials</a></li>
    <li><a href="#">Contact Us</a></li>
    </ul>
    </nav>



    nav {
    background-color: #fff;
    padding: 10px;

    }

    nav li{
    display:inline;
    list-style: none;
    }

    nav li a {
    padding-right: 25px;
    padding-left: 20px;
    text-decoration:none;
    color: #333;
    }

    nav li a:hover{
    color: #FFF ;
    background-color: #a10324 ;
    }

    nav li#active a{
    color: #FFF;
    background-color: #a10324;
    height: 41px;
    }

    ul {
    background-color: #fff;

    }

  2. #2
    Join Date
    Apr 2005
    Location
    Essex, United Kingdom
    Posts
    187
    I am not entirely sure what you are trying to achieve, but I think it might be top and bottom padding on each menu item right? If so, just add padding to your a elements.

    nav li a {
    padding:10px;
    padding-right: 25px;
    padding-left: 20px;
    text-decoration:none;
    color: #333;
    }

    You might need to remove the padding from the nav once you do this.

    ... or did i totally misunderstand what you wanted?

  3. #3
    Join Date
    Jun 2013
    Posts
    3
    Thanks for taking a look. It worked!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles