Selvaraj M A
Selvaraj M A

Reputation: 3136

Hiding horizontal scroll bars without using overflow-x

If I set overflow:scroll for a div with fixed height, then both horizontal scroll and vertical scroll bars appears. I know that I can remove horizontal scroll bars by using overflow-x:hidden. Is there a way to do this without using overflow-x because it fails in css(2.1) validation?

Ref: http://jsfiddle.net/s7SVZ/

Upvotes: 1

Views: 1668

Answers (1)

sandeep
sandeep

Reputation: 92803

YOu can give overflow:auto to it. Write like this:

#div1{
    width: 200px;
    height: 200px;
    overflow: auto;
    border: 1px solid red;
}

Check this http://jsfiddle.net/s7SVZ/1/

Upvotes: 5

Related Questions