html - IE9 在输入中裁剪文本

标签 html css internet-explorer internet-explorer-9

我有一个样式输入。如果出现问题,此输入可以是“红色”。这是我的片段:

.field {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  display: inline-block;
  font-weight: normal;
  outline: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-top-color: rgba(0, 0, 0, 0.3);
  vertical-align: baseline;
  -webkit-box-shadow: inset 0 1px 0 0 rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 1px 0 0 rgba(0, 0, 0, 0.05);
  font-size: 16px;
  padding: 6px 8px 7px;
  margin: 0 !important;
  height: 32px;
  line-height: 17px;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.field.field-red {
  border-radius: 2px;
  border: 1px solid #d43517;
  -webkit-box-shadow: 0 0 0 1px #d43517;
  box-shadow: 0 0 0 1px #d43517;
}
<input type="text" class="field">
    <p />
    <input type="text" class="field field-red">

在IE9以外的所有浏览器都可以。 IE9“裁剪”字母的底部(例如,q 和 g)。怎么了?

最佳答案

减少 field padding: 6px 8px 7px;padding: 3px 8px 7px; 并增加 height: 32px ;高度:35px;

.field {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  display: inline-block;
  font-weight: normal;
  outline: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-top-color: rgba(0, 0, 0, 0.3);
  vertical-align: baseline;
  -webkit-box-shadow: inset 0 1px 0 0 rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 1px 0 0 rgba(0, 0, 0, 0.05);
  font-size: 16px;
  padding: 3px 8px 7px;
  margin: 0 !important;
  height: 35px;
  line-height: 17px;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.field.field-red {
  border-radius: 2px;
  border: 1px solid #d43517;
  -webkit-box-shadow: 0 0 0 1px #d43517;
  box-shadow: 0 0 0 1px #d43517;
}
<input type="text" class="field">
    <p />
    <input type="text" class="field field-red">

关于html - IE9 在输入中裁剪文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31828306/

相关文章:

html - 我可以用 CSS 实现吗?

html - Bootstrap 4 : Is there a fix/workaround for false anti-aliasing in MS Edge for the border of sticky th

css - 在 ie 上调试 css 的最佳方法是什么?

javascript - IE9 不支持 localStorage?

javascript - 如何使用纯 javascript 将 css 边距值转换为像素?

javascript - 我需要添加一个用作幻灯片的轮播

html - 在 div 中居中对齐文本

html - Chrome 自动突出显示我的扩展程序中的按钮

html - 错误的 jpg 在 ie 上呈现

html - SVG 图像未固定到 Bootstrap 父列 div 中