Home > Web Front-end > HTML Tutorial > Differences in CSS about whether multiple selectors contain spaces_html/css_WEB-ITnose

Differences in CSS about whether multiple selectors contain spaces_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:38:43
Original
1183 people have browsed it

The difference in CSS about whether multiple selectors contain spaces

There is a big difference between multiple selectors in CSS containing spaces and not containing spaces, and the following meanings are distinguished:

#header.callout { }#header .callout { }
Copy after login

The first one represents the selector with the ID of header and the class name of callout,
The second one represents the selector with the class name of callout in the child node with the ID of header

We use the following example to show:

#header.callout { }<div id="header" class="callout"></div>
Copy after login
#header .callout { }<div id="header" class="callout">    <div class="callout">    </div></div>
Copy after login

#header .callout { } What we select is the sub-div with the class name callout.

Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.

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