Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Sep 2011
    Posts
    274
    Thanks
    49
    Thanked 1 Time in 1 Post

    div background color not visible

    Hi Folks.

    On this website, #navigation should be 960px wide, with a background-color of #F6F6F6

    Why does #navigation not spread to the right of the nav menu? I can see the body where #navigation should be.

    Thanks
    Last edited by SRD75; 08-03-2013 at 06:41 AM.

  • #2
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,742
    Thanks
    0
    Thanked 244 Times in 239 Posts
    Hi there SRD75,

    the reason for this is that your "#navigation div" contains floated elements.

    It could be cured by adding "overflow:hidden" to it's attributes but this would
    then hide the drop down parts of your menu.

    This...
    Code:
    
    #navigation:after {
        content:'';
        display:block;
        clear:both;
     }
    ...is the solution that would avoid this.

    coothead

  • Users who have thanked coothead for this post:

    SRD75 (08-03-2013)

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Set a width of 20% to #navigation ul li
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #4
    New to the CF scene
    Join Date
    Jul 2013
    Location
    Bangalore
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello,

    #navigation a {
    color: #000000;
    padding: 10px 42.1% 10px 43%;
    }
    css page in Line no. 99 update above code

  • #5
    Regular Coder
    Join Date
    Sep 2011
    Posts
    274
    Thanks
    49
    Thanked 1 Time in 1 Post
    Thank you all.

    I used coothead's solution first, and it works as intended.

  • #6
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,742
    Thanks
    0
    Thanked 244 Times in 239 Posts

    No problem, you're very welcome.

    coothead


  •  

    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
    •