div with screen width and with scroling
I would like to create a div that w开发者_开发问答ill have the screen width (any screen) and if the content is out of the screen width - I want to display horizontal scroll bar. How can I achieve this?
The scroll will appear in the div if the div content is bigger if you add the next style to the div container:
overflow: auto;
And if you want to dont display the vertical scroll you need:
overflow-y: hidden;
you can use like this....
#width1
{
height:200px;
border:1px solid black;
width:100%;
overflow:auto;
}
<div id="width1"></div>
Have a look at this fiddle:http://jsfiddle.net/Laqqn/1/
精彩评论