How to ensure that the height of all <h3> tags is consistent
P粉121447292
2023-08-20 11:15:19
<p>I got the h3 tag. one of the lower
I tried using margin: 0 and padding but it didn't work and I don't know where I went wrong. </p>
<p>After removing align-items: center, the height was fixed, but how to make it centered in the image container without destroying the height of h3
Picture</p>
<p><br /></p>
<pre class="brush:css;toolbar:false;">.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;
}</pre>
<pre class="brush:html;toolbar:false;"><div class="info-footer">
<div class="info-footer-info">
<h3>Menu 1</h3>
<ul>
<li><a href="#">About us</a></li>
<li><a href="#">FAQ</a></li>
<li><a href="#">Terms and Conditions</a></li>
<li><a href="#">Privacy Policy</a></li>
</ul>
</div>
<div class="info-footer-menu">
<h3>Menu 2</h3>
<ul>
<li><a href="#">Contact us</a></li>
</ul>
</div>
</div></pre>
<p><br /></p>
Remove
align-items: center;
from the.info-footer
style.align-items
The function is:Selecting
center
means placing the element in the center of theflex
container and laying out around this center. In other words, yourfooter-info
andfooter-menu
are aligned with the center of the flex container, not the starting position.