margin auto mistake

Website is sticking to the left, can't understand why. tried using
margin:auto
margin:auto
on body, didn't work live link :https://ahadweb3.github.io/Fitness-Landing-Page/ source: https://github.com/AhadWeb3/Fitness-Landing-Page
3 Replies
Joao
Joao3y ago
You have the following rule in place:
* {
margin: 0;
padding: 0;
max-width: 1440px; /* <----*/
list-style: none;
text-decoration: none;
font-family: 'Poppins', sans-serif;
border: 1px solid red;
}
* {
margin: 0;
padding: 0;
max-width: 1440px; /* <----*/
list-style: none;
text-decoration: none;
font-family: 'Poppins', sans-serif;
border: 1px solid red;
}
If you do want to enforce that limit and have the empty space on the sides, you have to apply the max-width on the body instead. I'm not quite sure why that is though, but it works. I think it's probably because it's applying to everything and that would affect the document itself?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Abdul Ahad⚡
Abdul Ahad⚡OP3y ago
done, thanks a lot
Want results from more Discord servers?
Add your server