I have heard that there are features in HTML5 and CSS3 to implement a dropdown list which expands on hover, without using list tags such as and .
But I am very confused as to how exactly go about it. Is it something related to flex ?
I have heard that there are features in HTML5 and CSS3 to implement a dropdown list which expands on hover, without using list tags such as and .
But I am very confused as to how exactly go about it. Is it something related to flex ?
here is a dropdown only with HTML, CSS3 and DIVs without lists and without javascript, jquery etc. I hope this is alright for you. Cheers :)
.mainMenu {
display: flex;
flex-direction: column;
overflow: hidden;
width: 200px;
height: 30px;
background-color: darkgrey;
color: black;
font-family: Arial;
line-height: 30px;
-webkit-transition: max-height 0.5s ease-in-out;
-moz-transition: max-height 0.5s ease-in-out;
-o-transition: max-height 0.5s ease-in-out;
transition: max-height 0.5s ease-in-out;
}
.mainMenu:hover {
color: white;
background-color: #2f6992;
cursor: pointer;
height: 150px;
}
.subMenu {
width: 100%;
height: 30px;
padding-left: 5px;
}
.subMenu:hover {
color: yellow;
}
.title {
color: white;
background-color: darkgrey;
width: 100%;
height: 30px;
padding-left: 5px;
}
<div class="mainMenu">
<span class="title">HOVER HERE...</span>
<div class="subMenu">Menu 1</div>
<div class="subMenu">Menu 2</div>
<div class="subMenu">Menu 3</div>
</div>