`
fengpeng
  • 浏览: 99573 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

html中的css class是从右向左匹配的

    博客分类:
  • Html
阅读更多
关键字: CSS   html css    

唉,这个世界有太多的东西等着你去发现,今天看dhtmlGrid的源码时才发现这个,也许是我火星了!

代码
  1. <html>  
  2.   <head>  
  3.     <style>  
  4.       .c1{background-color:red}   
  5.       .c2{background-color:yellow}   
  6.     </style>  
  7.   </head>  
  8.   <body>  
  9.     <div class="c1 c2">  
  10.       testCSS   
  11.     <div>  
  12.   </body>  
  13. </html>  
<script>render_code();</script>
div是黄色的,
如果代码是这样的
代码
  1. <html>  
  2.   <head>  
  3.     <style>  
  4.       .c1{background-color:red}   
  5.       .c3{background-color:yellow}   
  6.     </style>  
  7.   </head>  
  8.   <body>  
  9.     <div class="c1 c2">  
  10.       testCSS   
  11.     <div>  
  12.   </body>  
  13. </html>  
<script>render_code();</script>
那么div就是红色的
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics