css - firefox chrome 按钮的填充问题

标签 css google-chrome firefox padding

我的元素有问题,我不知道怎么办,chrome 和 firefox 与我的按钮显示的高度不同。我环顾四周,发现 firefox 的按钮有问题,所以我添加了下面的代码,但仍然不起作用。会是什么?

.button-type::-moz-focus-inner { border: 0; padding: 0; margin:0; }


.button-type {
  background: #a9a9a9;
  -webkit-border-radius: 5px;
  border-radius: 5px;
  -webkit-box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 3px rgba(255,255,255,0.2), inset 0 2px rgba(255,255,255,0.2), inset 0 28px 22px rgba(255,255,255,0.2), inset 0 -10px 28px rgba(0,0,0,0.2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 3px rgba(255,255,255,0.2), inset 0 2px rgba(255,255,255,0.2), inset 0 28px 22px rgba(255,255,255,0.2), inset 0 -10px 28px rgba(0,0,0,0.2);
  font: Arial, Helvetica, sans-serif;
  line-height: 1;
  padding: 8px 15px;
  width: auto;
  height: auto;
  border: none;
  text-align: center;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
  display: block;
  text-decoration: none;
  text-shadow: -1px -1px #333;
}
.button-type.black {
  background: #000;
  color: #fff;
}
.button-type.gray {
  background: #a9a9a9;
}
.button-type.light-gray {
  background: #d3d3d3;
  color: #222;
}

最佳答案

解决它的解决方案(和错误)是:

display:block

替换为:

display:inline

关于css - firefox chrome 按钮的填充问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15403415/

相关文章:

html - <select> 元素比 rest 元素短一点

html - 防止 fieldset 元素的边框穿过图例元素

c++ - 如何用c++安装浏览器扩展?

google-chrome - 防止桌面上的 PWA 安装提示 chrome 76?

html - !IE 的条件注释会中断旧版本的 Firefox

html - 当浏览器窗口大小调整为 1100 像素或更小时,主图下方的巨大差距

html - 在选中的复选框状态下无法更新输入 CSS3 上方的样式跨度

javascript - 模拟按键事件按下,强制按住向下箭头?

firefox - 自动启动 x-server 和自己的服务

javascript - 如何在没有更改事件的情况下禁用 firefox 表单自动完成?