Adding scrollbars to HTML

This is a really really dangerous question, and I think I already know the answer, but:

Can you add scrollbars to the <div> side?

+4
source share
3 answers

CSS

 div { height: 100px; overflow: auto; } 

jsFiddle .

You specify an explicit height so that the div does not expand to fit its contents.

If you only need horizontal or vertical scrolling, use overflow-x and overflow-y respectively.

If you want additional content to be hidden on the track, use overflow: hidden .

By default, the overflow property is visible .

+8
source

Css:

 overflow:auto; 

or force the scroll pane, even if the content is not full:

 overflow-y:scroll; 
0
source

This will add a scrollbar to the div

  <div style="overflow:auto; height:556px;width:564px;"> </div> 
0
source

Source: https://habr.com/ru/post/1345035/


All Articles