I would like to see the specific style elements that are used in the default stylesheet for the various browsers. Do the browsers have an actual file based stylesheetss that I locate on my system and read? If so, what are the default locations of those files? If not, where I can find this information?
10 回答
在 Firefox 上,在同一目录中查找 res/html.css 和其他 CSS 文件。
或者只是resource://gre-resources/forms.css
在 Firefox 中打开。
检查浏览器中的 html 元素并在右下角找到 css 规则。您将找到用户代理样式或浏览器样式(在 Firefox 中命名为 html.css)。复制文件位置并在选项卡中打开它 - 你去。
位置默认样式表
火狐 - 资源://gre-resources/html.css
铬 - https://chromium.googlesource.com/chromium/blink/+/master/Source/core/css/html.css
你可以为别人找。
在 Mozilla Firefox 中,将此链接输入到地址字段: jar:file:///Applications/Firefox.app/Contents/Resources/omni.ja!/chrome/toolkit/res/
在这里,您将找到 Firefox 的所有默认样式。计数器、表单、全屏、通用 html、数学、数字、纯文本、怪癖、ua 和视图源有单独的样式表。
有关用户代理样式表的更完整列表,请参见此处。
Some do some don't. (on a slightly different subject) I would recommend using a reset stylesheet.
In Safari, the Web Inspector will show you the CSS cascade for any element, including properties that were overridden, all the way back to the default CSS. Unfortunately, it won't show you the filename for that default CSS, but it will show you what properties were reset. Hopefully that helps a bit.
这可能与您问题的核心无关,但如果我猜对了您为什么需要此信息,您可能需要查看browsershots.org。
Browsershots 可以在不同的浏览器中截取您的网页设计。
换句话说,您可以在许多不同的浏览器、浏览器版本和平台上看到您的网站的外观。
The default stylesheet is generally not available. I recommend starting your own stylesheet with a "reset styles" part, or including reset styles in a style sheet you load first. Eg.
<link rel="stylesheet" type="text/css" media="screen" href="/stylesheets/reset.css"></link>
<link rel="stylesheet" type="text/css" media="screen" href="/stylesheets/general.css"></link>
Eric Meyer ("the" Eric, just google Eric) offers a battle tested and widely used reset style sheet here: http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/
在 Opera 中,在 OSX 上,文件位于/Applications/Opera.app/Contents/Resources/Styles/user.css