horizontal scrollbar

后端 未结 5 1019
醉话见心
醉话见心 2021-01-06 00:24

How can I make an automatic horizontal scroll bar in my page if the content will overflow in its border.


     
        
相关标签:
5条回答
  • 2021-01-06 00:39

    Insert in the div style :

    overflow-x:scroll;
    
    0 讨论(0)
  • 2021-01-06 00:45
    overflow: auto;
    white-space: nowrap;
    

    http://jsfiddle.net/GCPDE/

    0 讨论(0)
  • 2021-01-06 00:47

    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>
    
    0 讨论(0)
  • 2021-01-06 00:53

    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>

    0 讨论(0)
  • 2021-01-06 00:57

    Change your style to this:

    style="width: 20px; height:30px; border:1px solid black; overflow:auto;"
    

    Just a case of incorrect syntax.

    0 讨论(0)
提交回复
热议问题