Monday, February 22, 2016

Add Scroll to DIV Tag

Adding scroll to your div tag in your website have many benefit. One of them is to save the space of your website and make your website more interesting because there is no irregular div tag. So this is the tutorial how to "Add Scroll to DIV Tag".

1. Make <style> tag under <head>
<style>

</style>

2. Copy CSS code below and paste it into that <style> tag.
.scroll{
  width: 300px;
  background: orange;
  padding: 10px;
  overflow: scroll;
  height: 300px;
  
  /*script untuk browser IE */
  scrollbar-face-color: #CE7E00; 
  scrollbar-shadow-color: #FFFFFF; 
  scrollbar-highlight-color: #6F4709; 
  scrollbar-3dlight-color: #11111; 
  scrollbar-darkshadow-color: #6F4709; 
  scrollbar-track-color: #FFE8C1; 
  scrollbar-arrow-color: #6F4709;
}

3. Create <div> tag witch "scroll" class under <body>.
<div class="scroll">

</div>

Script that take effect the most are the overflow: scroll; and height: 300px;. You can change the height value as you like or as you need.

Artikel Terkait

Add Scroll to DIV Tag
4/ 5
Oleh