Get back default properties after applying a global CSS reset

前端 未结 3 576
难免孤独
难免孤独 2020-12-11 18:57

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

         


        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-11 19:31

    Rather than wishing you could revert back to the browser-defaults, why not just set your own?

    All you would need to do is add your declarations under your global CSS reset:

    * { margin: 0; }
    h1 { margin: 10px 0; }
    

    The h1 takes precedence over the global selector *.

    This would help normalize your CSS.

提交回复
热议问题