gpt4 book ai didi

html - Css 显示和隐藏在除 Safari 之外的所有浏览器中工作。我怎样才能解决这个问题?

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

我有一个显示或隐藏元素的触发器开关,它在 chrome 上运行良好,但由于某些原因在 safari 中它不起作用,有什么想法吗?

   <a href='#show'class='show'>see more --></a>
<a href='#hide'class='hide'>hide</a>

<div class='hidden-stuff'>
hidden divs
</div>

CSS

      .show:focus + .hide {display: inline; }
.show:focus + .hide + .hidden-stuff {display: block;}

最佳答案

您可以通过添加 tabindex 属性来解决这个问题。

<a href='#show'class='show' tabindex="1">see more --></a>

你可以阅读更多关于这个 here .

关于html - Css 显示和隐藏在除 Safari 之外的所有浏览器中工作。我怎样才能解决这个问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37991639/

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