html - Firefox 绝对位置不同于 Chrome

标签 html css google-chrome firefox position

我最近遇到一些代码错误。基本上,绝对位置属性在 Chrome 上可以正常工作,但在 Firefox 上会产生不同的结果。任何想法为什么?

表示:

Chrome : Correct

火狐: Incorrect 注意:在 firefox 表示中,第二个小框存在但被切断了。

代码:

HTML:

<div id="card-info">
        </div>
        <div class="arrow-wrapper">
            <i class=" visible-lg arrow-left pull-left fa fa-arrow-circle-o-left fa-4x" aria-hidden="true"></i>
            <i class="visible-lg arrow-right pull-right fa fa-arrow-circle-o-right fa-4x" aria-hidden="true"></i>
        </div>

SCSS:

.left-arrow {
    right: 90%;
    left: 10%;
}
.right-arrow {
    left: 90%;
    right: 10%;
}
.arrow-wrapper {
    position: absolute;
    padding-left: 100px;
    padding-right: 100px;
    width: 100%;

}

最佳答案

将此 CSS 添加到 absolute 元素,因为当您使用 position:absolute;

时,firefox 需要一个明确的位置
left: 0;
right: 0;
top: 50%;

关于html - Firefox 绝对位置不同于 Chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40324701/

相关文章:

jquery - 相机幻灯片-自定义字幕显示

jQuery 手机 : Is it possible to have static navigation that doesn't fade with page transitions?

google-chrome - Chrome 最新 v68 缩放页面使用 ctrl + scroll

javascript - Google Chrome,同源策略杀死 Tampermonkey 脚本

javascript - JQuery 验证器 : error checking and message management

css - 在图像链接悬停时取消隐藏另一个 div

c# - 使用 jQuery 调用 ASP.Net 页面方法

javascript - 制作两个不同颜色的 Materialise 开关

php - 在 Yii 的文本字段中显示错误消息

javascript - 从 EPOS 浏览器发送数据 USB 端口