Browsers' default CSS stylesheets

2019-01-01 13:15发布

问题:

Are there any lists of default CSS stylesheets for different browsers? (browser stylesheets in tabular form)

I want to know the default font of text areas across all browsers for future reference.

回答1:

Not tabular, but the source CSS may be helpful if you\'re looking for something specific:

  • Firefox default HTML stylesheet
  • WebKit default HTML stylesheet

You\'re on your own with IE and Opera though.



回答2:

I suspect this is something of a moving target for all the browsers, but there is a default style sheet for HTML 4 as defined by the W3C.



回答3:

There probably is a list, this is why we use CSS Resets however.

  • Eric Meyer\'s Reset
  • Yahoo\'s Reset


回答4:

CSS class have compiled a list of CSS2.1 User Agent Style Sheet Defaults. Some links at the bottom of that page as well.



回答5:

You cannot possibly know all defaults for all configurations of all browsers into the future.

The way people get around this is to start their CSS by resetting everything to known values. Here\'s an example from one of the main CSS experts: http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/



回答6:

There was some discussion and testing done on www-style not too long ago:

http://lists.w3.org/Archives/Public/www-style/2008Jul/0124.html

http://lists.w3.org/Archives/Public/www-style/2008Jul/att-0124/defaultstyles.htm