【问题标题】:SASS - how to change the code if the browser is IESASS - 如果浏览器是 IE,如何更改代码
【发布时间】:2012-07-05 01:21:40
【问题描述】:

我正在学习 SASS 并使用 twitter bootstrap

http://twitter.github.com/bootstrap/base-css.html#buttons

twitter 引导程序使用的是 Less,但我找到了 SASS 的翻译。

对于.btn 有

  *border: 0; // Remove the border to prevent IE7's black border on input:focus

但边框仍然存在,如果您看到 twitter 引导按钮,它们在 IE 下是可以的。他们是怎么做到的?

【问题讨论】:

标签: css internet-explorer twitter twitter-bootstrap sass


【解决方案1】:

如果将边框从 1px 更改为 0px,则必须将 line-height 增加 2px。

.btn{
  *line-height: 20px;
 }

你需要更精确:

  • “我找到了 SASS 的翻译。”哪一个?
  • “...按钮在IE下都可以”哪个IE?

如果您尝试在 IE6 上设置透明边框,这可能会有所帮助:IE6 Issue - border-color:transparent not working

【讨论】:

  • 我只想为 IE 用户隐藏边框,因为它很暗。所以我使用的是 IE 8,我知道 * css hack 可以在 IE 7 及以下版本中使用
  • @MarianPetrov 你试过这个stackoverflow.com/questions/5714356/…
  • 我会试试的,现在我用的是border:0px/9;但这适用于 IE 10,但按钮​​在 IE 9 中很好,所以我想在 ie 8 及以下版本中隐藏它
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-04-13
  • 1970-01-01
  • 2011-11-29
  • 1970-01-01
  • 2018-04-20
  • 1970-01-01
相关资源
最近更新 更多