p 元素(重置 css)的默认填充和/或边距是多少? [英] What is the default padding and/or margin for a p element (reset css)?

查看:25
本文介绍了p 元素(重置 css)的默认填充和/或边距是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用重置 CSS 样式集有一段时间了,每次我要创建一个新网站时,最让我烦恼的是重置 p 标签边距和填充.我明白为什么,但我想知道 p 元素上的默认"填充和/或边距应该是什么?

I have been using a reset CSS set of styles for quite some time now and each time I got to create a new website, the reset the annoys me the most is the reseting of a p tag margin and padding. I understand why, but I'm wondering what the "default" padding and/or margin should be on a p element?

我猜这在浏览器之间并不一致,通常需要针对每个站点进行调整,但是否有一组最常见的边距和/或填充值?

I'm guessing this isn't consistent across browsers and often needs to be tweaked for each site, but is there a set of most common margin and/or padding values?

简短版本:是(例如)5px 边距顶部底部的填充...还是其他什么?

Short version: Is it (for example) 5px margin and padding on top and bottom...or something else?

推荐答案

CSS 2.1 规范 有一个用于 HTML 4 的 默认样式表.它只是提供信息而不是规范性的浏览器可能会使用它,但不是必须的.

The CSS 2.1 specification has an default style sheet for HTML 4. It’s just informative and not normative so browsers may use it but do not have to.

另一个资源可能是浏览器的网络开发工具.大多数可以向您展示应用于特定元素的级联规则.一个例子:Firefox 和 Safari (WebKit) 似乎对 p 元素使用 margin: 1em 0px.

Another resource could be the webdeveloper tools of the browsers. Most can show you the cascade of rules that were applied to a particular element. An example: Firefox and Safari (WebKit) seem to use margin: 1em 0px for p elements.

这篇关于p 元素(重置 css)的默认填充和/或边距是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆