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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2011
    Posts
    274
    Thanks
    49
    Thanked 1 Time in 1 Post

    scroll bars when width=100%

    Hi. When this website's viewport is less than 320px, there is a horizontal scroll bar.

    All DIVs are 100% wide, with no padding or margin.

    Why is the scroll bar there?
    Last edited by SRD75; 05-25-2013 at 11:57 AM.

  • #2
    Regular Coder Candygirl's Avatar
    Join Date
    Apr 2008
    Location
    Switzerland
    Posts
    184
    Thanks
    3
    Thanked 56 Times in 56 Posts
    hello,

    Because you have a width 100% + 1px border.
    You should use width:auto instead of 100%:

    Code:
    #title, #content, #sidebar {
        float: none;
        width: auto;
    }
    or you can play with the box-sizing property.
    "Imagination was given to man to compensate for what he is not;
    a sense of humour to console him for what he is."
    -Francis Bacon

  • Users who have thanked Candygirl for this post:

    SRD75 (05-25-2013)

  • #3
    Regular Coder
    Join Date
    Sep 2011
    Posts
    274
    Thanks
    49
    Thanked 1 Time in 1 Post
    Thanks Candygirl


  •  

    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
    •