在CSS中,id的优先级比class高,style的优先级比id高。

当一个div同时有class和id 设置样式时,id设置的样式会覆盖掉class设置的样式,但如果在这个div上面直接加style时,style的优先级最高,会覆盖掉原来的样式。


Leave Your Comment

Your email will not be published or shared. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">

*
请输入图片中的字符以验证你并非垃圾机器人. 点击图片收听验证码的语音版.
点击这里收听此验证码的语音版本