-webkit-margin在文本上增加了不必要的边距 [英] -webkit-margin adds unwanted margin on texts

查看:2761
本文介绍了-webkit-margin在文本上增加了不必要的边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这直到现在还没有打过我(这不仅仅是webkit的浏览器)。在所有文本中,像p标签,h1标签等...在文本之上和之下有一个额外的空间,在chrome我发现这:

This haven't hit me until now (and this is not only in webkit browsers). On all texts in like p tags, h1 tags etc...there's an extra space over and below the text, in chrome I found this:


用户代理样式表

user agent stylesheet



-webkit-margin-before: 1em;
-webkit-margin-after: 1em;
-webkit-margin-start: 0px;
-webkit-margin-end: 0px;

这会使对齐在某些地方错误。是的,我使用的是重置样式表,不添加填充或边距。几乎是一个基本的设置。

This makes the alignment wrong in some places. And yes I'm using a reset stylesheet and no padding or margin are added. Pretty much a basic setup. Why is this and how do I solve it?

推荐答案

您也可以直接修改这些属性:

You can also directly modify those attributes like so:

-webkit-margin-before:0em;
-webkit-margin-after:0em;

适用于Chrome / Safari。希望有所帮助!

Works for me in Chrome/Safari. Hope that helps!

这篇关于-webkit-margin在文本上增加了不必要的边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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