css优先级

xiaoxiao2021-02-28  76

【控制的越精细,优先级越高,可以用firebug查看!】

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>css优先级</title> <style type="text/css"> p{ color: red; } .test2{ color: yellow; } #test1{ color: blue; } div #test1{ color: orange; } </style> </head> <body> <div> <!-- 既有id 又有class的p标签 --> <p id="test1" class="test2">控制的越精细,优先级越高,可以用firebug查看</p> </div> </body> </html>

效果:

转载请注明原文地址: https://www.6miu.com/read-74356.html

最新回复(0)