Cara - Menu Vertikal
Pelajari cara membuat menu vertikal dengan CSS.
Menu Vertikal
Cara Membuat Grup Tombol Vertikal
Langkah 1) Tambahkan HTML:
Contoh
<div class="vertical-menu">
<a href="#"
class="active">Home</a>
<a href="#">Link
1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
<a href="#">Link 4</a>
</div>
Langkah 2) Tambahkan CSS:
Contoh
.vertical-menu {
width: 200px; /* Set a width if you like */
}
.vertical-menu a {
background-color: #eee;
/* Grey background color */
color: black; /* Black text
color */
display: block; /* Make the links appear below
each other */
padding: 12px; /* Add some padding */
text-decoration: none; /* Remove underline from links */
}
.vertical-menu a:hover
{
background-color: #ccc; /*
Dark grey background on mouse-over */
}
.vertical-menu a.active {
background-color: #04AA6D; /* Add a green color to the "active/current" link
*/
color: white;
}
Menu Gulir Vertikal
Tetapkan yang spesifik height
dan tambahkan overflow
properti jika Anda menginginkan menu gulir vertikal:
Contoh
.vertical-menu {
width: 200px;
height: 150px;
overflow-y: auto;
}
Tip: Lihat tutorial Cara - Navigasi Samping kami untuk mempelajari cara membuat navigasi samping yang tetap dan tinggi.