gpt4 book ai didi

html - CSS 过渡不适用于 safari

转载 作者:太空宇宙 更新时间:2023-11-04 13:11:06 25 4
gpt4 key购买 nike

Here是代码

我在选项卡悬停时创建了一个下拉菜单,向下滑动的过渡效果在除safari之外的所有浏览器中都可以正常工作。

我正在检查 safari 5.1.7

HTML

<nav class="tabs">
<ul class="clearfix">
<li><a href="">Tab 1</a>
<ul>
<li><a href="">SubMenu 1</a></li>
<li><a href="">SubMenu 2</a></li>
<li><a href="">SubMenu 3</a></li>
<li><a href="">SubMenu 1</a></li>
<li><a href="">SubMenu 2</a></li>
<li><a href="">SubMenu 3</a></li>
</ul>
</li>
<li><a href="">Tab 2</a>
<ul>
<li><a href="">SubMenu 1</a></li>
<li><a href="">SubMenu 2</a></li>
<li><a href="">SubMenu 3</a></li>
<li><a href="">SubMenu 1</a></li>
<li><a href="">SubMenu 2</a></li>
<li><a href="">SubMenu 3</a></li>
</ul>
</li>
<li><a href="">Tab 3</a>
<ul>
<li><a href="">SubMenu 1</a></li>
<li><a href="">SubMenu 2</a></li>
<li><a href="">SubMenu 3</a></li>

</ul></li>
</ul>
</nav>

CSS

* {
margin: 0;
padding: 0;
font-size: 16px;
font-family: arial;
}
a {
text-decoration: none;
padding: 10px;
display: block;
color: green
}
.clearfix:after {
clear: both;
content: " ";
display: block
}
ul {
list-style: none;
width: 100%;
background: red;
}
.tabs > ul > li {
float: left;
position: relative;
}
.tabs > ul > li > a {
position: relative;
background: red;
color: #fff;
z-index: 1;
padding: 10px 80px;
}
.tabs ul ul {
position: absolute;
left: 0;
top: -300px;
width: 200px;
text-align: center;
-webkit-transition: top 0.6s ease-in-out;
-moz-transition: top 0.6s ease-in-out;
-ms-transition: top 0.6s ease-in-out;
-o-transition: top 0.6s ease-in-out;
transition: top 0.6s ease-in-out;
background: yellow;

}
.tabs li:hover ul {
top: 39px;
}

无法弄清楚到底是什么问题。

最佳答案

已更新 code

只是改变

.tabs li:hover ul {
top: 100%;
}

.tabs li:hover ul {
top: 39px;
}

关于html - CSS 过渡不适用于 safari,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24692070/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com