odin-default-css-exercises/animation/02-drop-down/solution/solution.css

56 lines
872 B
CSS

* {
padding: 0;
margin: 0;
font-family: Arial, Helvetica, sans-serif;
}
.dropdown-container {
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.dropdown-menu {
position: relative;
}
.dropdown-button {
background-color: rgb(108, 238, 255);
padding: 16px;
font-size: 16px;
border: none;
}
ul {
position: absolute;
left: -25%;
background-color: rgb(189, 188, 188);
width: 160px;
list-style: none;
text-align: center;
overflow: hidden;
max-height: 0;
transition: max-height 0.25s ease-out;
}
li {
padding: 16px;
}
.dropdown-menu:hover ul {
max-height: 500px;
transition: max-height 0.5s ease-out;
}
.dropdown-menu:hover .dropdown-button {
cursor: pointer;
background-color: rgb(59, 232, 255);
}
.dropdown-content li:hover {
cursor: pointer;
background-color: #ddd;
}