gpt4 book ai didi

css - 绝对 :after displaying differently in firefox and webkit

转载 作者:行者123 更新时间:2023-11-28 17:47:58 25 4
gpt4 key购买 nike

我的网站上有一个精美的下拉菜单:http://www.blueleafstudio.net/environmentally-friendly-web-hosting/ (尝试顶部的“关于”或“支持”菜单项)

我在 webkit 浏览器上得到了我想要的行为,但 firefox 没有做同样的事情。

悬停时,会显示一个 li:after 元素。它具有绝对位置。 li 元素本身具有相对位置。

在 webkit 中,:after 元素的位置是相对于 li 的,但在 firefox 中它的位置是相对于 ul 标签的。

有谁能在保持菜单视觉效果不变的情况下解决这个问题?

最佳答案

此处列出了一个类似的问题:Does Firefox support position: relative on table elements?

基本上,这是 Firefox 支持表格单元格相对定位的问题,或者在您的情况下和元素设置为 display:table-cell;。他们在该示例中提出的解决方案是在“单元格”内添加相对定位的包装元素。

<li>
<div style="position:relative;">
<a href="">{..}</a>
<ul>{...}</ul>
</div>
</li>

关于css - 绝对 :after displaying differently in firefox and webkit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22870716/

25 4 0
文章推荐: javascript - 根据窗口大小缩放 HTML5 网页
文章推荐: javascript - jQuery 单击删除
文章推荐: javascript - 如何将参数传递给 onclick 函数
文章推荐: javascript - 如何在鼠标悬停时停止滚动
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com