Answer the question
In order to leave comments, you need to log in
How to center text in a listbox on Flex?
There is a horizontal menu located in a block, all on flexbox. How to make the text of "li" blocks centered vertically?
There is a margin-top, then the background also slides down, and I only need to lower the text a little lower.
I understand that it can be done faster on a div, but is there still a solution for a list?
<div class="top-menu">
<ul>
<li><a href="/">Главная</a></li>
<li><a href="#">Статьи</a></li>
<li><a href="#">VST Инструменты</a></li>
<li><a href="#">VST Плагины</a></li>
<li><a href="#">О нас</a></li>
<li><a href="#">Помощь проекту</a></li>
</ul>
</div>
.top-menu {
display: flex;
width: 40%;
justify-content: center;
background: yellow;
}
.top-menu>ul {
display: flex;
justify-content: space-between;
}
.top-menu>ul>li {
margin-right: 2.5em;
background: gray;
height: 100%;
}
.top-menu>ul>li>a {
color: white;
Answer the question
In order to leave comments, you need to log in
https://codepen.io/topicstarter/pen/agVmZK corrected a little bit
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question