HTML Scroll Box
An HTML scroll box is a box that grows scroll bars when it's contents are too large to fit in the box. How do you make the box? You create the box using a normal HTML element (such as the div element). Then, to make the box scroll, you apply the CSS overflow property to the div.
But, you don't need to worry about the technical details if you don't want to. You can simply copy and paste the HTML scroll box code below. Of course, you can change the values to suit (such as the size of the scroll box, color etc)
Basic HTML Scroll Box
Run
Stack editor
Unstack editor
As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.
Colored Scroll Boxes
Here's an example of an HTML scroll box with color added. You have a number of options when it comes to adding color to your scroll box. Click on the link to add color to your scroll boxes!
Run
Stack editor
Unstack editor
Customized Scrollbars
Use WebKit's extensions to customize your scrollbars. Also works on the browser's scrollbars (click Preview).
Run
Stack editor
Unstack editor
My Example/* Force scrollbars onto browser window */
body {
margin-bottom: 200%;
}
/* Box styles */
.myBox {
border: none;
padding: 5px;
font: 24px/36px sans-serif;
width: 200px;
height: 200px;
overflow: scroll;
}
/* Scrollbar styles */
::-webkit-scrollbar {
width: 12px;
height: 12px;
}
::-webkit-scrollbar-track {
border: 1px solid yellowgreen;
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
background: yellowgreen;
border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
background: #88ba1c;
}
Efficient honorificabilitudinitatibus cross-media information without floccinaucinihilipilification cross-media value. Quickly maximize timely deliverables for real-time schemas plenipotentiary.
Scroll Box with Images
You can also add images to your scroll box. This can be either a background image, or, one or more foreground images. Click on the link to add images to your scroll box!
Run
Stack editor
Unstack editor
Scroll Box Borders
Here's an example of an HTML scroll box with a border added. Click on the link to add a border to your scroll box!
Run
Stack editor
Unstack editor
Horizontal Scroll
Here's an example of an HTML scroll box with a horizontal scroll only. Click on the link to add horizontal scrolling to your scroll box!
Run
Stack editor
Unstack editor
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 200 percent, it is 200 percent wider than the parent container - forcing an overflow.