In this scenario, since you are working with inline
-level elements, you could add vertical-align: middle
to the span
elements for vertical centering:
.nav-text {
vertical-align: middle;
}
Alternatively, you could set the display
of the parent element to flex
and set align-items
to center
for vertical centering:
.menu {
display: flex;
align-items: center;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…