What is a user agent stylesheet?

后端 未结 14 760
无人及你
无人及你 2020-11-22 16:58

I\'m working on a web page in Google Chrome. It displays correctly with the following styles.

table {
    display: table;
    border-collapse: separate;
             


        
14条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-22 17:25

    Answering the question in title, what is the user agent stylesheet, the set of default styles in the browser: Here are some of them (and most relevant ones also in today's web):

    • Gecko (Firefox): https://dxr.mozilla.org/mozilla-central/source/layout/style/res/html.css

    • Chromium (Chrome): https://chromium.googlesource.com/chromium/src/third_party/+/master/blink/renderer/core/html/resources/html.css

    • WebKit (Safari): https://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css

    Personal opinion: Don't fight with them. They have good default values, for example, in rtl/bidi cases and are consistent nowadays. Reset what you see irrelevant to you, not all of them at once.

提交回复
热议问题