前端一HTML:十四: important
生活随笔
收集整理的这篇文章主要介绍了
前端一HTML:十四: important
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
一个选择器可以作用于很多个标签上,
一个标签也会被很多个选择器作用.
!important 属性不能被继承
作用: 将对应选择器的优先级设置为最高级
<!doctype html> <html lang="en"> <head><meta charset="UTF-8"><title>Document</title><style type="text/css">#one{color: pink;}.one{font-style: italic;color:blue;}div{font-size: 30px ;color:red !important; }body{color: yellow ;}* {color: purple ;}</style> </head> <body> haha<div class="father"><div class="one" id="one">abc</div></div> </body> </html>
总结
以上是生活随笔为你收集整理的前端一HTML:十四: important的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: const char * 、char c
- 下一篇: 前端一HTML:十五: 权重的比较