What is User Agent StyleSheets?

10

Studying on CSS I came across the term User Agent , or standard style sheets used by browsers in the absence of style sheets.

  • What is the User Agent ?
  • Each browser has a User Agent ?
  • Is there any way to ignore them, if so how?

default Google Chrome set the body of the HTML document with margin: 8px ;

    
asked by anonymous 17.11.2016 / 11:39

1 answer

9

This indicates that the default style was set in the browser (or another form that is being used to render that element). It is only used if no style has actually been used on it, even on other levels.

Remember that CSS works cascaded, one element always inherits properties previously defined at another level. The first of these levels, which is usually overlaid by a more specific level, is the user agent , which is the browser default.

The order would be:

  • User agent style sheets (the browser)
  • User normal style sheets (a custom user configuration)
  • Author normal style sheets (you made the page)
  • Author important style sheets (when you say it is "important )
  • User important style sheets (when the user says it is "important )

This can be seen in the specification .

You ignore this use by creating a style of your own, which is what everyone else does.

    
17.11.2016 / 11:49