标签: A + B { / *样式* / } 所有< A> 这是一个适合我的问题的示例HTML: / p> < a>一些文字< / a> < b>一些文字< / b> 解决方案 编辑:为了更有帮助,如果您使用例如jQuery(JavaScript库),您可以使用 .prev() 。 This selects all <B> tags directly preceded by <A> tags:A+B { /* styling */}What is the selector for all <A> tags directly followed by <B> tags?Here's sample HTML fitting my question:<a>some text</a><b>some text</b> 解决方案 You can’t in css.Edit: To be a bit more helpful, if you use for example jQuery (a JavaScript library), you can use .prev(). 这篇关于一个标记的选择器,后面紧跟另一个标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
05-27 11:49
查看更多