Some legacy code that I have to build upon, really makes me feel the cons of global CSS reset.
I have the old foo.css
that starts with
* {margin:0; padding:0;}
and I used to copy it to a different file bar.css
, tweak it too my needs (out with the CSS reset), and use it to replace foo.css
only in the code I'm writing. I do this not to worry about backwards compatibility with the older sections of the site.
Now this is quite cumbersome: for global changes I have to remember to modify both files. So now my bar.css
is extending foo.css
, starting with:
@import url("style.css");
The problem is that now I also inherit the CSS reset.
Is there any way(?) to bring the margin
& padding
properties of some elements (headers, lists etc.) back to their default values -- the ones before the reset was applied?
(?) other than manually setting every property back to its initial value, as defined in the CSS specs.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…