Answer the question
In order to leave comments, you need to log in
How to center an element on the cross axis on hover (flexbox)?
Horizontal site menu. It is necessary to describe the hover behavior.
/* Menu Styles */
.menu {
background: #313030;
height: 12vh;
display: flex;
justify-content: space-around;
}
ul {
list-style: none;
padding: 0;
margin: 0;
}
li {
text-transform: uppercase;
display: inline-block;
margin-right: 2vh;
padding-left: 3vh;
padding-right: 3vh;
}
li:hover {
background: #ff3f40;
height: 12vh;
margin-right: 2vh;
padding-left: 3vh;
padding-right: 3vh;
}
a {
color: #e0e0e0;
}
a:hover {
text-decoration: none;
color: #e0e0e0;
}
nav {
display: flex;
align-items: center;
}
Answer the question
In order to leave comments, you need to log in
you add height not to hover but to default and with hover change only background or make padding height li
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question