What is causing that nasty horizontal scrollbar? [closed]
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this questionI am wrapping up a few touches on a site and notice that something is forcing the horizontal scrollbar to appear way beyond the container boundaries here.
I have Firebugged it to death开发者_运维知识库, but still can't figure out what the offending party is. I offer quick kudos to anyone that can tell me what is wrong here.
Thanks!
Someone else posted an answer earlier and then withdrew it. It was close but not all the way there.
Here is what ended up solving the problem:
html
{
height: 100%;
margin-bottom: 1px;
overflow-y: scroll;
overflow-x: hidden;
}
I think it has to do with the margin on the #container div.
When I Inspect Element on Google Chrome and change the margin style to margin: 0;
the scroll bar goes away.
try adding: padding: 0px;
to the style. it stays centered and the scroll bar goes away.
Something important to check for in addition to padding and margin is a border. A border will add width to your element.
border: none;
padding: 0px;
margin: 0px;
That should fix it
精彩评论