So I have a div tag to sort of draw boxes around various sections, and of course make actual sections.
In one of the sections, there is more text than can be held in the div tag, so I want to for the text within the div tag to have a scroll bar to make it so the text doesn't overflow outside of the box.
How would I do that?
Add width
and height
CSS properties to the div
, as well as overflow:auto
If you add overlow:scroll
, the scroll bars will be always visible.
If you want to have only horizontal scroll, add white-space:nowrap
to the element inside of the div
.
Use the following:
div {
overflow: scroll;
}
If you want them to scroll only in one direction, you can use the overflow-x
and overflow-y
properties.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With