有区别吗:
<span id="test" class="one two"></span>
和
<span id="test" class="two one"></span>
如果这些类上存在冲突的 CSS 规则,顺序是否重要?
jQuery 中是否有用于重新排序的 API?当我调用 addClass()
时,它是否总是结束?
最佳答案
顺序无关紧要。
这里的重点是
If two rules are equal in all of the above, the one declared last wins. CSS embedded in the html always come after external stylesheets regardless of the order in the html
关于jquery - 选择器上的类的顺序重要吗?如果是,我可以指定顺序吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8439803/