A
A
Anastasia2020-06-11 14:50:25
css
Anastasia, 2020-06-11 14:50:25

How to align images and text vertically in a list?

There is such a list:

5ee2199b52b89726554509.png

<div class="header">
<div class="header-bottom-panel">
<ul>
<li><a href=""><img src="img/img.svg">First</a></li>
<li><a href=""><img src="img/img.svg">Second</a></li>
<li><a href=""><img src="img/img.svg">Third</a></li>
<li><a href=""><img src="img/img.svg">Fourth</a></li>
<button>Start</button>
</ul>
</div>
</div>


.header {
    justify-content: space-between !important;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.header .header-bottom-panel ul {
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-bottom-panel ul li {
    margin-left: 30px;
    font-size: 16px;
    color: #191E57;
}


And you want the images and text to be vertically centered in this list. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaliy Pershin, 2020-06-11
@patsooo

For links write:

display: flex;
justify-content: center;
align-items: center;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question