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
    New to the CF scene
    Join Date
    Apr 2014
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry Background colour issue...

    Hey there! I am trying to make my mother a website, and I only started it today and already having an issue..

    I have a div set up underneath the nav bar for the main content which has a background colour, it all looks fine until you zoom in, then when you scroll to the right, the colour changes to the body background colour... I can't work out how to fix it...

    Any help is much appreciated, here is a link to something very similar I put online.. Excuse the horrible colours...

    Also, notice that if you zoom out however much it looks fine, but if you zoom in so that you need to scroll it messes up...

    Edit fiddle - JSFiddle


    Cheers, Brad.

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

    and a warm welcome to these forums.

    Try changing this...
    Code:
    
    div.main
    {
        background-color:red;
        width:100%;
        min-height:470px;
    }
    ...to this...
    Code:
    
    div.main
    {
        background-color:red;
        min-width:100%;
        min-height:470px;
    }


    coothead

  • #3
    New to the CF scene
    Join Date
    Apr 2014
    Location
    Yuba City, CA
    Posts
    9
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Being that anything you put int your DIV is going to stay on that red background when you zoom in, you could just set overflow-x to hidden on the body tag. This way, you can't scroll right and see the black background. The way your navbar is though isn't working.

  • #4
    New to the CF scene
    Join Date
    Apr 2014
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Changing the width to min-width didn't help fix the issue, and I did know about the overflow-x to hidden, but then if you zoom in, the nav bar will be unreachable... is there not a way to change the width of the div in relation to the document size... :/ or is there any other way I could achieve the same result ? Cheers, brad

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

    I apologise for my 'faux pas'.

    It should, of course, have been...
    Code:
    
    div.main
    {
        background-color:red;
        min-width:960px;;
        min-height:470px;
    }

    coothead

  • #6
    New to the CF scene
    Join Date
    Apr 2014
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    After reading your first post seeing the min-width 100% it got me thinking and I got it anyway!! But thanks a bunch for your help!


  •  

    Posting Permissions

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