Vertically align navigation items to center. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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)

3rd Oct 2020, 6:51 AM
Bibek Oli
Bibek Oli - avatar
5 Answers
+ 2
You are using flexbox so you can use align-items:center; This will also work vertical-align:middle;
3rd Oct 2020, 7:29 AM
Arnav Kumar [Less/Not Active]
Arnav Kumar [Less/Not Active] - avatar
+ 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
3rd Oct 2020, 7:03 AM
Kelvin Paul
Kelvin Paul - avatar
+ 1
Kelvin Paul I already tried it. It's not working.
3rd Oct 2020, 7:09 AM
Bibek Oli
Bibek Oli - avatar
+ 1
Kelvin Paul I was changing the code in my ide. It is working now after adding: header nav { vertical-aling:middle } Thank you.😁
3rd Oct 2020, 7:16 AM
Bibek Oli
Bibek Oli - avatar
+ 1
Bibek Oli welcome bro☺
3rd Oct 2020, 7:20 AM
Kelvin Paul
Kelvin Paul - avatar