我有一个显示或隐藏元素的触发器开关,它在 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/