How can I make an automatic horizontal scroll bar in my page if the content will overflow in its border.
Insert in the div style :
overflow-x:scroll;
overflow: auto;
white-space: nowrap;
http://jsfiddle.net/GCPDE/
change your code into this:
<html>
<body>
<div style ="width: 20px; height:30px; border:1px solid black; overflow-x:scroll">
<!-- various of text here that can makes it go out the border-->
</div>
</body>
</html>
NOTE: In order to make text horizontally scrollable you will have to add overflow-x:scroll; overflow-y: hidden; white-space: nowrap; to your div.
<html>
<body>
<div style ="width:20px; height:30px; border:1px solid black; overflow-x:scroll; overflow-y:hidden; white-space:nowrap;">
<!-- various of text here that can makes it go out the border-->
</div>
</body>
</html>
Change your style to this:
style="width: 20px; height:30px; border:1px solid black; overflow:auto;"
Just a case of incorrect syntax.