您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

CSS中两个类选择器之间有没有空格的差别

2025/3/19 19:23:11发布33次查看
css中两个类选择器之间有没有空格的区别:
<!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>
结论:css中两个类选择器之间没有空格形成多类选择器, 有空格形成后代选择器 。       
以上就是css中两个类选择器之间有没有空格的差别的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product