Whenever you want to add scrollbar to any html block you can use below code.

This can be used for displaying codes, high resolution image or map or anything where you want your website visitor to see all details by scrolling left-right and top-bottom.

Tagging CSS to scroll element

If you want to use scroll for any tag like <div> or <p> or any else, use a tag id or class.


<div class=”scroll”>Demo text to see scroll in working
<img src=”my-scrollbar-banner.png” class=”size-full” alt=”Adding Scrollbar through CSS”>
<h1>Main Title</h1>
<p>Content of Adding Scrollbar through CSS blog post</p>
<h2>Second Title</h2>
<p>More content of Adding Scrollbar through CSS blog post</p>

CSS Code:

.scroll { overflow: scroll; }

If you want to scrollbar for left-right only (vertically) use overflow-x & if you want it to scroll up and down only use overflow-y.