+ 4
Vertically align navigation items to center.
I want to align the navigation items vertically to center of the header, but can't do it after trying a lot also😁 Please help me to do that. Code link: https://code.sololearn.com/WUg1B45saPxi/?ref=app (See in the desktop desktop site)
5 Réponses
+ 2
You are using flexbox so you can use
align-items:center;
This will also work
vertical-align:middle;
+ 1
https://www.w3schools.com/cssref/playit.asp?filename=playcss_vertical-align&preval=super
Center is not a value of vertical-align
You can use
vertical-align:middle;
Instead of center
+ 1
Kelvin Paul I already tried it. It's not working.
+ 1
Kelvin Paul I was changing the code in my ide.
It is working now after adding:
header nav {
vertical-aling:middle
}
Thank you.😁
+ 1
Bibek Oli welcome bro☺