@LeikoRed
Posted
I see you are using:
not(ul, ol, li) {margin: 0; padding: 0;}
since it targets all elements except ul, ol, and li, setting their margin and padding to zero. It'd be prefered to use the universal selector. The :not selector is used for more specific cases where you need to exclude particular elements, but in this scenario isn't necessary because you don't use ul
, ol
or li
.
*{
margin: 0;
padding: 0;
}
It is good tho
Hi @LeikoRed 👋🏻
Me using not(ul, ol, li) {margin: 0;}
was born from me wanting a shorter selector to target instead of using body, h1, h2, h3, h4, h5, h6, p {margin: 0;}
to remove margins.
My personal preference is to reuse the initial lines of code in /* #region Defaults */
over and over across multiple projects so I no longer have to worry about overwriting margins for these commonly used elements [body, h1, h2, h3, h4, h5, h6, p].
While I did consider using the shorter * {margin: 0;}
, it just personally felt weird to me when my lists did not have their default indentation in other projects like Recipe Page
With the wildcard selector *
literally selecting everything, I don't want to have to worry about moments where certain html elements not looking right without their margin and padding.
This is just me being lazy, but I'm going to keep my not(ul, ol, li) {margin: 0;}
selector for now until I find something better 😂
Thank you for the comment though 🙌🏻