how to hide horizontal scrollbar in div tag

ngmajid picture ngmajid · Jul 13, 2010 · Viewed 40k times · Source

I have a div with size x=540px y=600px

I want to hide horizontal scroll bar even if text is bigger than x size.

How can i hide just the horizontal scroll bar?

Answer

rob waminal picture rob waminal · Jul 13, 2010

use overflow-x

<div class="MyDivClass"></div>

CSS:

.MyDivClass {
    height: 600px;
    width: 540px;
    overflow-x: hidden;
}

if you also want to hide the vertical use overflow-y: hidden; or for both just overflow: hidden;