I have a css reset where I put margin to zero. Then further down the code I want to add a margin-bottom to all the elements. But it isn't working and I can't find out why.
I have tried to use the !important rule but that isn't working either and not really the solution I'm after. In my head the specificity should work because they both have the specificity 0,0,1 and the last rule should apply.
Or is it like that the *
rule has specificity 0,0,0 and doesn't "beat" the specificity of the others selectors after html and body tags because they have specificity 0,0,1?
html,body,address, article, aside, footer, header, h1, h2, h3, h4,
h5, h6, hgroup, main, nav, section {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
body > * {
margin-bottom: calc(1 * var(--line-height));
}
The result I'm after is that the body > *
should apply.