<div class="dropdown">
<button class="dropbtn">ALAT</button>
<div class="dropdown-content">
<a href="index2.php"><img src="home.jpg" class="home" width="70px" height="50px" title="Dashboard"></a>
<a href="papar_topik.php"><img src="quiz.jpg" class="quiz" width="70px" height="50px" title="Kuiz"></a>
<a href="prestasi_topik.php"><img src="prestasi.png" width="70px" height="50px" title="Prestasi Pelajar"></a>
<a href="senarai_pelajar.php"><img src="senarai.jpg" class="senarai" width="70px" height="50px" title="Senarai Pelajar"></a>
<a href="import_daftar.php"><img src="import.jpg" class="import" width="70px" height="50px" title="Import Daftar"></a>
<a href="#" onclick="logout()"><img src="logout.png" width="70px" height="50px" title="Keluar"></a>
The code above creates a dropdown button. To make the dropdown content appear with a transition when the mouse moves near the button, you can use the following CSS code:
div{
font-size: 20px;
text-align: center;
top: 170px;
left: 1000px;
}
.dropbtn {
background-color: aqua;
color: black;
padding: 16px;
font-size: 20px;
font-family: brush script mt;
font-style: bold;
border-radius: 50%;
}
.dropdown {
position: fixed;
display: inline-block;
}
.dropdown-content {
display: none;
position: fixed;
background-color: cornsilk;
width: 120px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
height: 0px;
transition: all .5s ease;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {
background-color: yellow;
}
.dropdown:hover .dropdown-content {
display: block;
top: 10px;
height: 1000px;
}
However, if the dropdown content is not showing any transitions and just appears as usual, consider checking on where you placed the "transition" tag in your CSS code.