Browsers' default CSS for HTML elements

前端 未结 4 1850
执笔经年
执笔经年 2020-11-22 04:55

Where can I find a browser\'s default CSS for HTML elements?

Many HTML elements come with some default CSS properties which can sometimes result in

4条回答
  •  情书的邮戳
    2020-11-22 05:29

    It's different for each browser, so:

    • Firefox (Gecko): https://dxr.mozilla.org/mozilla-central/source/layout/style/res/html.css. Or, browse to resource://gre-resources/ and look at html.css.
    • Chrome/Safari (WebKit): http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css
      • Chrome (Blink): https://chromium.googlesource.com/chromium/blink/+/master/Source/core/css/html.css
    • Internet Explorer (Trident), older versions: http://web.archive.org/web/20170122223926/http://www.iecss.com/

    You can also look at the HTML5 Boilerplate stylesheet, which "normalizes the display of a lot of stuff without being a reset in the traditional sense". It also fixes quite a few bugs/inconsistencies.

    It's also worth looking at: https://github.com/necolas/normalize.css/blob/master/normalize.css

提交回复
热议问题