What was the reason for specifying .footer-background
to have a display: flex
property in order to center the .copyright-text
? Why did setting display: flex
on .footer
not achieve the desired result?
.footer-background {
background-color: #00008B;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
}
.copyright-text {
color: #fff;
}
.container {
max-width: 1200px;
padding: 0 48px;
margin: 0 auto;
}
<div class="footer-background">
<footer class="container footer">
<p class="copyright-text">Copyright © The Odin Project 2021</p>
</footer>
</div>