Reset/remove CSS styles for element only

前端 未结 14 871
长情又很酷
长情又很酷 2020-11-22 00:52

I\'m sure this must have been mentioned/asked before but have been searching for an age with no luck, my terminology must be wrong!

I vaguely remember a twee

14条回答
  •  伪装坚强ぢ
    2020-11-22 01:33

    BETTER SOLUTION

    Download "copy/paste" stylesheet‎ to reset css properties to default (UA style):
    https://github.com/monmomo04/resetCss.git

    Thanks@Milche Patern!
    I was really looking for reset/default style properties value. My first try was to copy the computed value from the browser Dev tool of the root(html) element. But as it computed, it would have looked/worked different on every system.
    For those who encounter a browser crash when trying to use the asterisk * to reset the style of the children elements, and as I knew it didn't work for you, I have replaced the asterisk "*" with all the HTML tags name instead. The browser didn't crash; I am on Chrome Version 46.0.2490.71 m.
    At last, it's good to mention that those properties will reset the style to the default style of topest root element but not to the initial value for each HTML element. ‎So to correct this, I have taken the "user-agent" styles of webkit based browser and implemented it under the "reset-this" class.

    Useful link:


    Download "copy/paste" stylesheet‎ to reset css properties to default (UA style):
    https://github.com/monmomo04/resetCss.git

    User-agent style:
    Browsers' default CSS for HTML elements
    http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css

    Css specifity (pay attention to specifity) :
    https://css-tricks.com/specifics-on-css-specificity/

    https://github.com/monmomo04/resetCss.git

提交回复
热议问题