浏览器的HTML元素的默认CSS [英] Browsers' default CSS for HTML elements
问题描述
我在哪里可以找到HTML元素的浏览器默认CSS?
许多HTML元素都有一些默认的CSS属性,在未知/不需要的行为。例如,输入框在不同的浏览器中显示不同。我正在寻找一个涵盖新的CSS3属性和新的HTML5元素的地方。
我在其他问题(例如浏览器的默认CSS样式表)答案建议CSS重置的解决方案。这个解决方案有时是不需要的,通常我实际上想保留一些基本属性(如在Chrome中突出显示输入框)。换句话说:我不想因为我不知道他们做什么而摆脱某些东西。
因此, strong>是否有一个网站可以给我所有这些信息(或者也许是最多的)?
- Firefox(Gecko): https://dxr.mozilla.org/mozilla-central/source/layout/style/res/html.css 。或者,浏览到
resource:// gre-resources /
并查看html.css
。 - Chrome / Safari(WebKit): http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css
- Internet Explorer (Trident),旧版本: http://www.iecss.com/
根据robertc的建议,您还可以查看HTML5 Boilerplate样式表,它标准化很多东西的显示,而不是传统意义上的重置。它还修复了很多错误/不一致。
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 unknown/unwanted behaviour. For example Input boxes are displayed differently in different browsers. I'm looking for a place that covers the new CSS3 properties and the new HTML5 elements.
I've seen in other (much older) questions (such as Browsers' default CSS stylesheets) answers that suggest a solution of CSS reset. This solution is sometimes not wanted, often I would actually like to keep some of the basic properties (such as the highlighting of input boxes in Chrome). In other words: I don't want to get rid of things just because I don't know what they do.
So, Is there a site that can give me all this information (or perhaps most)?
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 athtml.css
. - Chrome/Safari (WebKit): http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css
- Internet Explorer (Trident), older versions: http://www.iecss.com/
As suggested by robertc, 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.
这篇关于浏览器的HTML元素的默认CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!