Home >Web Front-end >JS Tutorial >Is there any difference in spaces between two class selectors in CSS?
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>
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!