CSS: How to hide unwanted vertical or horizontal scrollbars in blogger

The code for it is this, and it is pretty straightforward:

body {
    overflow-y: hidden; /* Hide vertical scrollbar */
    overflow-x: hidden; /* Hide horizontal scrollbar */
}

The trick is where to place the code. If you place it on the body like it is done inside the code above this will effectively hide all the scrollbars from the body portion of your site, which is probably not what you want. I have used this code to hide scrollbars from headers where I played around with header heights and was suddenly stuck with vertical scrollbars; or sidebars where I played around with the width and was stuck with horizontal ones. So, in such cases you would look for things like sidebar and header wrappers: 

.sidebar-wrapper {
    overflow-x: hidden; /* Hide horizontal scrollbar */
}

or:

#header-blog {
    overflow-y: hidden; /* Hide vertical scrollbar */
}

Note: Hunting for the appropriate div class to place the code for the sidebar will be easier, but the header may need some work since headers have different names. This #header-blog term that I have used here only applies to this one theme where I am looking, other themes are very likely to have entirely different names. Point in case, another that I just took a peak at says .nwpaper-center-header - so, go figure... 


Powered by Blogger.