Home > Web Front-end > JS Tutorial > body text

Is there any difference in spaces between two class selectors in CSS?

一个新手
Release: 2017-09-26 10:03:59
Original
1990 people have browsed it

The difference between two class selectors in css is whether there are spaces or not:

##

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			.p1.p2{width: 100px;height: 100px;background: red;}/*多类选择器*/
			.p1 .p2{width: 100px;height: 100px;background: yellow;}/*后代选择器*/
		</style>
	</head>
	<body>
		<p class="p1 p2"></p>
		<p class="p1">
		    <p class="p2"></p>	
		</p>	
	</body>
</html>
Copy after login



Conclusion: There is no space between two class selectors in cssForm Multi-class selector , has spaces to form a descendant selector .

The above is the detailed content of Is there any difference in spaces between two class selectors in CSS?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!