微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用CSS制作和看起来一样

我想制作< button>和< a>看起来一样.我发现了一个类似的帖子,建议添加

Box-sizing: content-Box;
-webkit-Box-sizing: content-Box;
-moz-Box-sizing: content-Box;

但是,在Firefox中查看时,它仍然有轻微的高度差异.这是jsfiddle.任何帮助?

最佳答案
http://jsfiddle.net/H3HK8/22/

button::-moz-focus-inner,.btn::-moz-focus-inner
{
    border: 0;
    padding: 0;
}

这修复了中间的,仍然在最终输入.

从这里http://www.aheadcreative.com/removing-unwanted-button-padding-in-firefox/

UPDATE

我怀疑最后的例子你是这个http://www.cssnewbie.com/input-button-line-height-bug/#.USzRd6Wcmzc的受害者

您可以在此示例http://jsfiddle.net/H3HK8/24/中看到行高无效,即使添加了!important.

And while trying to work around this rule,I discovered something that makes the situation a little more dire: browser-defined !important rules cannot be over-ruled by author-defined !important rules. This rule cannot be overruled by a CSS file,an inline style — anything.

原文地址:https://www.jb51.cc/css/427139.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。