Home > Web Front-end > HTML Tutorial > A question about CSS selector priority_html/css_WEB-ITnose

A question about CSS selector priority_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:02:46
Original
823 people have browsed it

<span style="font-size:14px;"><html>  <head>    <style type="text/css">        #redP p {             /* 权值 = 100+1=101 */             color:#F00;  /* 红色 */        }         #redP .red em {             /* 权值 = 100+10+1=111 */             color:#00F; /* 蓝色 */         }         #redP p span em {             /* 权值 = 100+1+1+1=103 */             color:#FF0;/*黄色*/        }    </style>  </head>  <body>     <div id="redP">        <p class="red">red           <span><em>em red</em></span>        </p>        <p>red</p>     </div>  </body></html></span>
Copy after login

Click to see if the effect is what you want
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template