flexbox无法在Firefox中运行

时间:2015-10-03 04:36:40

标签: firefox navigation flexbox

以下的flexbox代码在firefox中不起作用。它是一个横跨浏览器宽度的水平导航列表。在所有其他浏览器中,li的空间相同,但在firefox中他们不会。有任何想法吗?提前致谢。

.wrapper {
  position: fixed;
  padding: 0;
  width: 100%;
  top: 0em;
}
.flex-container-top {
  padding: 1em;
  margin: 0;
  list-style: none;
  display: -webkit-box;
  display: -moz-box;
  display: -ms-flexbox;
  display: -webkit-flex;
  display: flex;
}
.flex-item {
  font-family: sans-serif;
  font-size: 1em;
  color: #fff;
  text-align: center;
}
<div class="wrapper">
  <ul class="flex-container-top">
    <li class="flex-item"><a href="#eastsidedin">Link 1</a>
    </li>
    <li class="flex-item"><a href="#eastsidedes">Link 2</a>
    </li>
    <li class="flex-item"><a href="#eastsidedri">Link 3</a>
    </li>
    <li class="flex-item"><a href="#eastsidehap">Link 4</a>
    </li>
  </ul>
</div>

1 个答案:

答案 0 :(得分:0)

你的例子在Chrome中也不起作用。

您需要将.flex-item添加到.flex-item { flex: 1; /* add this line */ font-family: sans-serif; font-size: 1em; color: #fff; text-align: center; } 。然后它会工作:

    FragmentManager fragmentManager = getSupportFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    int count = getSupportFragmentManager().getBackStackEntryCount();

    String currentTag = getSupportFragmentManager().getBackStackEntryAt(getSupportFragmentManager().getBackStackEntryCount() - 1).getName();
    Fragment currentInstance = getSupportFragmentManager().findFragmentByTag(currentTag);
    fragmentTransaction.remove(currentInstance);
    fragmentTransaction.commit();
    fragmentManager.popBackStack(getSupportFragmentManager().getBackStackEntryCount() - 1, FragmentManager.POP_BACK_STACK_INCLUSIVE);
    int count1 = getSupportFragmentManager().getBackStackEntryCount();