开发者

Is there a standard CSS margin/padding/etc. for HTML elements?

开发者 https://www.devze.com 2023-04-11 08:43 出处:网络
I believe WordPress does something like this, they use a CSS reset stylesheet, then manually apply a global margin for each HTML element (to increase 开发者_StackOverflow中文版browser compatibility).

I believe WordPress does something like this, they use a CSS reset stylesheet, then manually apply a global margin for each HTML element (to increase 开发者_StackOverflow中文版browser compatibility). I'm looking for something like this, but without the WordPress specific elements.

On a similar note, is there a default stylesheet that WebKit uses that I can access?


You may want to consider using normalize.css as opposed to a reset.css; checking their demo seems to indicate this includes standards for form elements:

http://necolas.github.com/normalize.css/


a quick google search turned up this: http://meyerweb.com/eric/tools/css/reset/ and this: http://html5doctor.com/html-5-reset-stylesheet/ among others


I generally use YUI Reset CSS for this. YUI Base CSS can complement Reset by applying a style foundation for common HTML elements that is consistent across A-grade browsers. YUI is from Yahoo and hence enjoys good support and is presumably more reliable than other similar CSS frameworks.


default Chrome WebKit http://codesearch.google.com/codesearch/p#OAMlx_jo-ck/src/third_party/WebKit/Source/WebCore/css/html.css

here's a butt load more default user agent style sheets http://meiert.com/en/blog/20070922/user-agent-style-sheets/


There's no standard CSS margin etc. that I know of...

That's one of the reasons why a reset stylesheet is necessary. No one sets the same styles and most browsers have different defaults.

For me, once I reset margin and padding on most elements, I usually make the margin around 1em for p, h1-h5, etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号