是否可以设置样式<option>独立于<select>在 Safari 中? [英] Is it possible to style <option> independently of <select> in Safari?
本文介绍了是否可以设置样式<option>独立于<select>在 Safari 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
标题是不言自明的,但本质上,Chrome 和 Firefox 尊重我独立设置 和
元素样式的权限,而Safari 不是.有解决方法吗?
The title is pretty self-explanatory, but essentially Chrome and Firefox are respecting my authority to style the <select>
and <option>
elements independently, whereas Safari is not. Is there a workaround?
谢谢!
推荐答案
这是我的解决方法:
我没有使用 框,而是使用了
并设置了列表项的样式.然后使用一些 JS/jQuery 我添加了 行为.如果这是您的选择,它将消除浏览器支持问题.
Instead of using a <select>
box I used a <ul>
and styled the list items. Then with a bit of JS/jQuery I added the <select>
behavior. If this is an option for you, it will eliminate the browser support issues.
这篇关于是否可以设置样式<option>独立于<select>在 Safari 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文