Example Code: Scroll Box
Result:
As you can see, once there's enough text in this box, the box will include scroll bars... that's why it's called scroll box! You could also place images and video into the scroll box. The beauty in using a scroll bar it that when you're limited on the amount of space you have on your website, the scroll bar provides you with the ability to place as much text as you need on the page.
Example Code: Scroll Box Color
Result:
We have added a background color to this HTML scroll box. This is done using the CSS 'background-color' property.
Example Code: Scroll Box with Image
Result:
Example Code: Scroll Box Color Boarders
Result:
You can add borders to HTML scroll boxes using the CSS 'border' property. Borders can be of any thickness, and any color. You can specify whether it's solid, dotted, dashed, and more. You can also specify a different border for each side of your scroll box.
Example Code: Horizontal Scroll Box
Result:
By using overflow-x, we can create scroll bars when the contents of this div are wider than the container. By setting this paragraph to 250 percent, it is 250 percent wider than the parent container - forcing an overflow.
Example Code: Vertical Scroll Box
Result:
By using overflow-y, we can create scroll bars when the contents of this div are bigger/higher than the container. Also, by setting this paragraph to 250 percent, it is automatically 250 percent higher than the parent container - forcing an overflow.