I got h3 tags. One is lower
I tried using margin: 0 and padding but it didn’t worked and i don’t know what is wrong.
After deleting align-items: center it fixed the height but how to make it in center of container on picture without breaking height of h3
Image
.info-footer {
background-color: rgba(33, 40, 59, 0.8);
color: #fff;
border: 1px solid rgb(53, 56, 72);
width: 100%;
height: 14em;
display: flex;
justify-content: center;
gap: 200px;
padding: 20px 10px;
align-items:top;
}
<div class="info-footer">
<div class="info-footer-info">
<h3>Menu 1</h3>
<ul>
<li><a href="#">O nas</a></li>
<li><a href="#">FAQ</a></li>
<li><a href="#">Regulamin</a></li>
<li><a href="#">Polityka Prywatności</a></li>
</ul>
</div>
<div class="info-footer-menu">
<h3>Menu 2</h3>
<ul>
<li><a href="#">Kontakt</a></li>
</ul>
</div>
</div>
4
Answers
Always use the appropriate HTML tags. CSS flex will align these for you.
change align-items:center to align-items:start and wrap everything in a container. Give height of 100vh to the container and use flex again
remove
align-items: center;
from.info-footer
style.What
align-items
does is:Choosing
center
means it places the elements to the center of theflex
container and works its way around that. In other words, yourfooter-info
andfooter-menu
are aligned to the center of the flex container rather than the start.to achive what you want with being able to center the info you can wrap them inside another div so the
align-items
won’t effect them