Ada banyak jenis scroolbar yang umumnya digunakan untuk meringkas sebuah tulisan, secara umum dibagi menjadi tiga yaitu scroll horisontal, scroll vertikal dan scrool gabungan vertikal dan horisontal. Berikut ini cara membuat scrool secara lengkap
Scrollbar Horisontal
Scrooll horisontal artinya tulisan di ringkas dalam bentuk memanjang, untuk membuat scroll horisontal gunakan kode yang tertera dibawah ini.
<div style=”border:1px solid black;width:auto ;height:50px;overflow-y:hidden;overflow-x:scroll;”>
<p style=”width:2500%;”>
MASUKKAN TULISAN ANDA DISINI
</p>
</div>
Keterangan
Border = Ukuran garis tepi srcoll
Solid = Warna garis tepi scroll
Height = Tinggi scrool,
Width:2500% = Ukuran panjang scroll yang digunakan untuk mengeser Scroll
Width = Lebar kotak scroll, Anda bisa merubah ukuran lebar menjadi auto agar otomatis sesuai dengan ukuran lebar postingan.
Untuk kode berikutnya gunakan cara yang sama untuk merubah warna, ukuran lebar, tinggi. Hasil Scroll dengan kode HTML diatas adalah seperti dibawah ini.
Scrollbar Vertikal Tipe 1
<div style=”background-color: #f0f0f0; border: 1px solid #1E90FF; height: 50px; overflow: auto; padding: 5px; width: auto;”>
MASUKKAN TULISAN ANDA DISINI
</div>
Hasil Scroll dengan kode HTML diatas adalah seperti dibawah ini.
Scrollbar Vertikal Dan Horisontal
<div style=”border:1px solid red;width:auto;height:50px;overflow-y:scroll;overflow-x:scroll;”>
<p style=”width:2500%;”>
MASUKKAN TULISAN ANDA DISINI
</p>
</div>
Hasil Scroll dengan kode HTML diatas adalah seperti dibawah ini.
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.
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.
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.
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.
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.
Scrollbar Vertikal Tipe 2
Scrooll vertiakal artinya tulisan di ringkas dalam bentuk memanjang dari atas kebawah, namun untuk kode HTMlL yang digunakan dalam kode ini sedikit berbeda. untuk membuat scroll vertikal gunakan kode yang tertera dibawah ini.
<div style=”border: 1px solid green; height: 80px; overflow-x: hidden; overflow-y: scroll; width: auto;”>
<p style=”width:250%;”>
MASUKKAN TULISAN ANDA DISINI
</p>
</div>
Hasil Scroll dengan kode HTML diatas adalah seperti dibawah ini.