如何阻止IE创建像素化按钮?

Don*_* V. 1 html css internet-explorer

我知道我之前遇到过这个问题,但由于某些原因,IE决定将我的提交按钮设为像素化.

有谁知道如何解决这一问题?

scu*_*ffe 7

像素化通常发生在IE6和IE7中,因为它在IE8中得到修复: 错误101

诀窍是将CSS应用于按钮......

/* Apply CSS class "button" to your input buttons */
.button{
  width:auto; /* fix stretching in IE for 16-20 char buttons */
  overflow:visible; /* fix stretching in IE for 16-20 char buttons */
  padding-left:4px; /* force sensible padding in IE */
  padding-right:4px; /* force sensible padding in IE */
}
Run Code Online (Sandbox Code Playgroud)

这并不能解决所有问题,但它确实可以最大限度地减少影响.

以下屏幕截图显示所有按钮(应用了样式)具有"可敬的"填充(例如,它不会疯狂​​地增长).还要注意,在某些时候按钮仍然会失败并且像素化......但是你可以在它们失败之前挤出更多的字符.(最多25个字符,而19个......取决于字体系列和大小)

IE按钮拉伸部分修复http://img523.imageshack.us/img523/3990/iebuttons.png