I’ve got a problem with centering the list in my footer, it looks as if there’s padding on the left side preventing it from centering.
<footer>
<div class="footerContainer">
<img src="/images/middle.png" class="center" style="width: 100%;">
<div class="footerNav">
<ul><li><a a target="###">My Store</a></li>
<li><a href="#artwork">My Artwork</a></li>
<li><a href="#webdesigns">My Web designs</a></li>
<li><a href="#top">Back to top</a></li>
</ul>
</div>
</div>
</footer>
footer{
background-color: rgb(35, 18, 61);
}
.footerContainer{
width: 100%;
padding: 20px 30px 20px ;
text-align: center;
}
.footerNav{
margin: 30px 0;
}
.footerNav ul{
display: flex;
justify-content: center;
list-style-type: none;
}
.footerNav ul li a{
margin: 20px;
text-decoration: none;
font-size: 1.2em;
}
@media (max-width: 360px){
.footerNav ul{
flex-direction: column;
}
.footerNav ul li{
text-align: center;
margin: 10px;
}
}
I’ve tried adding text-align: center;
to every footer element, I’ve also added tried margin: 0 auto;
and I’ve looked through the padding and margins through the rest of my HTML file but nothing changes after deleting them. What am I missing?
New contributor
Erikas Petrauskas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.