【问题标题】:Why doesn't margin-top using percent work in IE7?为什么在 IE7 中使用百分比的 margin-top 不起作用?
【发布时间】:2011-09-26 06:23:49
【问题描述】:

IE7好像看不懂top: 106%

.flex-caption {
  width: 76%;
  margin-left: 170px;
  position: absolute;
  left: 0;
  right: 0;
  top: 106%;
  color: #b8b8b8;
  font-size: 14px;
  line-height: 48px;
}

http://www.juxt2.com/test/skeleton/index.html

我有哪些选择?

我正在做一个响应式设计,所以我不能使用px

我也愿意接受仅在 IE7 中运行的 JavaScript/jQuery 修复。

【问题讨论】:

  • 忘记发布网址:juxt2.com/test/skeleton/index.html
  • 可能有一个 CSS 修复,但您已经在使用 JavaScript/jQuery 进行幻灯片放映,因此您可以使用 JavaScript 在 IE7 的条件注释中修复此问题。 $(window).resize(function() { /* update top value */ });.
  • 感谢您的回答。但是由于我是 javascript 的新手,请介意更具体一点吗?我的意思是你能提供一个可行的例子吗?

标签: javascript jquery css internet-explorer-7


【解决方案1】:

尝试在它旁边添加 !important。喜欢 :- margin-top !important;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-17
    • 1970-01-01
    • 1970-01-01
    • 2012-03-20
    相关资源
    最近更新 更多