When my Blog displays on some screens, it shows horizontal scrollbars.
Its not good for my layout!
How can i override or prevent horizontal scrollbars on some user display screens?
Your content is simply too wide. Considering the vast amount of negative space involved, simply shrinking it down would probably be the best way to go.
You can't (or rather shouldn't) prevent the horizontal scrollbars when your content is too wide for the screen, as this will mean that users are unable to access the part of your content that exists offscreen.. If you don't want scrollbars on those screens, make your content fit on their screens.
You can do this in a couple of ways:
- A narrow layout for everyone.
- A fluid or semi-fluid layout that shrinks or grows based on the size of the user's browser. An overview can be found here.
if you'd still like to hide the horizontal scrollbars (which i have done here) You can set these in the css:
overflow: scroll; //Scroll sets the scrollbars to always be visible, even when the content is not longer than the page/div/element, set it to auto to let it appear only when the content exceeds the parent element. overflow-x: hidden; // This hides the horizontal scrollbar