'底部'在Edge中不起作用

时间:2016-10-02 07:17:55

标签: html css cross-browser microsoft-edge

我有以下HTML:



.arrow {
  width: 50px;
  position: fixed;
}
.arrow.arrow-right {
  top: 0;
  bottom: 0;
  margin: auto;
  right: 15px;
}
.arrow.arrow-bottom {
  left: 0;
  right: 0;
  margin: auto;
  bottom: 15px;
  transform: rotate(90deg);
}

<img src="http://bestanimations.com/Signs&Shapes/Arrows/Left/left-arrow-15.gif" class="arrow arrow-bottom" />
<img src="http://bestanimations.com/Signs&Shapes/Arrows/Left/left-arrow-15.gif" class="arrow arrow-right" />
&#13;
&#13;
&#13;

我希望第一个箭头靠近屏幕右边缘,第二个箭头靠近屏幕底部。

这正是Chrome,Firefox和Opera中发生的事情:

enter image description here

在Edge中,似乎&#39;底部&#39;规则只是被忽略了:

enter image description here

为什么会这样?

Fiddle

1 个答案:

答案 0 :(得分:3)

只需更改为以下内容:

.arrow.arrow-bottom {
    left: 0;
    right: 0;
    margin: 0 auto; /* instead of auto */
    bottom: 15px;
    transform: rotate(90deg);
}

margin: auto导致了这个问题。如果它解决了这个问题,请告诉我。