Grow your CSS skills. Land your dream job.

Website Stretching on a Big Screen Desktop Computer

  • # June 16, 2013 at 5:00 am

    Just opened my website on LG big flat screen desktop computer and the pages stretched all the way to the left and right. Although it didn’t have a horizontal bar because the website is actually responsive, but it didn’t have a single pixel of white space at the right and left sides. Whereas the width of the web pages is 1000px. What made the page to stretch to cover the full width of the screen? Do I need to make the width like this:

    .container{
    max-width:1000px;
    }

    # June 16, 2013 at 5:10 am

    Yes. If you didn’t specify any (max-)width, block-level elements had the full width of their parent (default 100%).

    # June 16, 2013 at 5:16 am

    Ok. So I should give it only max-width or should I do something like this:

    .container{
    width:1000px;
    max-width:1000px;
    }

    # June 16, 2013 at 5:20 am

    No. This will lead to an horizontal scroll bar when < 1000px. Just a max-width will be alright.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".