Home  >  Article  >  Web Front-end  >  css 串联选择器和后代选择器介绍及示例

css 串联选择器和后代选择器介绍及示例

WBOY
WBOYOriginal
2016-06-01 09:53:051864browse

串联选择器:作用在同一个标签上 

<code class="language-html"><div class="”a”" id="qq"><span>look at the color</span></div> 
css: #qq.a{ 
…. 
}</code>

后代选择器:作用在不同标签上 

<code class="language-html"><div id="qq"><span class="”a”">look at the color</span></div> 
css: #qq .a{ 
}</code>

注意#qq .a 之前有空格

Statement:
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