位置在Firefox中不起作用?

杰森·阿克塞尔罗德(Jason Axelrod)

好的,所以我有一个滑块(使用bx-slider)。

在chrome中,滑块看起来很完美。但是,在Firefox中,不会显示文字叠加层。如果右键单击并检查元素,将看到以下css设置:

.featuresGrid ul li .summary {
    position: absolute;
    bottom: 0px;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

如果我暂时禁用position: absolute,然后重新启用它,则文字叠加层会突然正常工作。为什么它们在初始页面加载时损坏?顺便说一句,它在IE中也坏了。

* {
  margin: 0;
  padding: 0
}
.featuresGrid .featuresOuter {
  position: relative;
  z-index: 1;
  background-color: #000;
  overflow: hidden;
}
.featuresOuter .bx-wrapper {
  max-width: 100%;
}
.featuresOuter .bx-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
  height: 200px;
}
.featuresOuter .bx-viewport > .heightFix {
  width: auto;
  position: relative;
}
.featuresOuter .heightFix {
  height: 200px;
}
.featuresOuter ul li {
  list-style: outside none none;
  position: absolute;
  z-index: 0;
  width: 1158px;
}
.featuresGrid ul li a {
  position: relative;
}
.featuresGrid ul li .summary {
  position: absolute;
  bottom: 0px;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.5)
}
<div class="section featuresGrid" id="featuresGrid">
  <div class="featuresOuter">
    <div class="bx-wrapper">
      <div class="bx-viewport">
        <ul class="heightFix">
          <li>
            <a href="#">
              <div class="heightFix">
                <div class="summary">
                  <div class="title">SoulCast #34: The GloomyCast</div>
                  <div class="excerpt">"GloomyCast" kind of sounds like a bad weather report, doesn't it? In any case, a big ring made of deathblades seems a bit dangerous for the user, if you ask me, but warning labels aren't going to keep Tira down! This episode SaltFace_GA
                    was kind enough to come on to the podcast and talk some Tira strats. I had to fight a little technical difficulty, but I hope you still enjoy! Only a couple of characters left after this! 8104 YouTube channel:...</div>
                </div>
              </div>
            </a>
          </li>
        </ul>
      </div>
    </div>
  </div>
</div>

i

问题在于您.summary相对于锚点(这是一个内联元素)相对定位。这可能是有问题的。

然后,您可以添加

.featuresGrid ul > li > a {
  display: block;
}

* {
  margin: 0;
  padding: 0
}
.featuresGrid .featuresOuter {
  position: relative;
  z-index: 1;
  background-color: #000;
  overflow: hidden;
}
.featuresOuter .bx-wrapper {
  max-width: 100%;
}
.featuresOuter .bx-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
  height: 200px;
}
.featuresOuter .bx-viewport > .heightFix {
  width: auto;
  position: relative;
}
.featuresOuter .heightFix {
  height: 200px;
}
.featuresOuter ul li {
  list-style: outside none none;
  position: absolute;
  z-index: 0;
  width: 1158px;
}
.featuresGrid ul li a {
  position: relative;
  display: block;
}
.featuresGrid ul li .summary {
  position: absolute;
  bottom: 0px;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.5)
}
<div class="section featuresGrid" id="featuresGrid">
  <div class="featuresOuter">
    <div class="bx-wrapper">
      <div class="bx-viewport">
        <ul class="heightFix">
          <li>
            <a href="#">
              <div class="heightFix">
                <div class="summary">
                  <div class="title">SoulCast #34: The GloomyCast</div>
                  <div class="excerpt">"GloomyCast" kind of sounds like a bad weather report, doesn't it? In any case, a big ring made of deathblades seems a bit dangerous for the user, if you ask me, but warning labels aren't going to keep Tira down! This episode SaltFace_GA
                    was kind enough to come on to the podcast and talk some Tira strats. I had to fight a little technical difficulty, but I hope you still enjoy! Only a couple of characters left after this! 8104 YouTube channel:...</div>
                </div>
              </div>
            </a>
          </li>
        </ul>
      </div>
    </div>
  </div>
</div>

另外,您可以.summary相对.heightFix以下位置

.featuresOuter .heightFix {
  position: relative;
}

* {
  margin: 0;
  padding: 0
}
.featuresGrid .featuresOuter {
  position: relative;
  z-index: 1;
  background-color: #000;
  overflow: hidden;
}
.featuresOuter .bx-wrapper {
  max-width: 100%;
}
.featuresOuter .bx-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
  height: 200px;
}
.featuresOuter .heightFix {
  height: 200px;
  position: relative;
}
.featuresOuter ul li {
  list-style: outside none none;
  position: absolute;
  z-index: 0;
  width: 1158px;
}
.featuresGrid ul li a {
  position: relative;
  display: block;
}
.featuresGrid ul li .summary {
  position: absolute;
  bottom: 0px;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.5)
}
<div class="section featuresGrid" id="featuresGrid">
  <div class="featuresOuter">
    <div class="bx-wrapper">
      <div class="bx-viewport">
        <ul class="heightFix">
          <li>
            <a href="#">
              <div class="heightFix">
                <div class="summary">
                  <div class="title">SoulCast #34: The GloomyCast</div>
                  <div class="excerpt">"GloomyCast" kind of sounds like a bad weather report, doesn't it? In any case, a big ring made of deathblades seems a bit dangerous for the user, if you ask me, but warning labels aren't going to keep Tira down! This episode SaltFace_GA
                    was kind enough to come on to the podcast and talk some Tira strats. I had to fight a little technical difficulty, but I hope you still enjoy! Only a couple of characters left after this! 8104 YouTube channel:...</div>
                </div>
              </div>
            </a>
          </li>
        </ul>
      </div>
    </div>
  </div>
</div>

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

位置:粘性在Firefox中不起作用

来自分类Dev

.onscroll jQuery在Firefox中不起作用

来自分类Dev

日期输入在Firefox中不起作用

来自分类Dev

jQuery Datepicker在Firefox中不起作用

来自分类Dev

Flexslider在Firefox或Safari中不起作用

来自分类Dev

Roboto字体在Firefox中不起作用

来自分类Dev

toISOString在Firefox中不起作用

来自分类Dev

SVG在Mozilla Firefox中不起作用

来自分类Dev

垂直居中在Firefox中不起作用

来自分类Dev

animationEnd / .removeClass在Firefox中不起作用

来自分类Dev

字体样式在Firefox中不起作用

来自分类Dev

Firefox中的Bootstrap Modal不起作用

来自分类Dev

下载属性在Firefox中不起作用

来自分类Dev

Pipelight Silverlight在Firefox中不起作用

来自分类Dev

Javascript代码在Firefox中不起作用

来自分类Dev

Pipelight Silverlight在Firefox中不起作用

来自分类Dev

Adblock plus在Firefox中不起作用

来自分类Dev

Kinetic JS在Firefox中不起作用

来自分类Dev

功能JQuery在Firefox中不起作用

来自分类Dev

Wappalyzer插件在Firefox中不起作用

来自分类Dev

AngularJS示例在Firefox中不起作用

来自分类Dev

程序在FireFox中不起作用

来自分类Dev

transitionEnd在Firefox中不起作用

来自分类Dev

垂直居中在Firefox中不起作用

来自分类Dev

nsICacheService在Firefox 38中不起作用

来自分类Dev

Flexbox在Firefox中不起作用

来自分类Dev

在Firefox中调整大小不起作用

来自分类Dev

setTimeout在Firefox中不起作用

来自分类Dev

Silverlight在Firefox中不起作用