类选择器和ID选择器有什么区别,为标签设置id="ID名称",而不是class="类名称"有什么区别?
汪汪
汪汪 2016-12-21 10:51:09
0
2
1242

为标签设置id="ID名称",而不是class="类名称"不都一样吗?不就是换了一个样式而已?

汪汪
汪汪

reply all(2)
数据分析师

What is the difference between a class selector and an ID selector? What is the difference between setting id="ID name" for a tag instead of class="class name"? -PHP Chinese Questions and Answers - What is the difference between a class selector and an ID selector? What is the difference between setting id="ID name" for a tag instead of class="class name"? -PHP Chinese website Q&A

Please watch and learn.

阿神

当然有区别了,对于dom而言,id是唯一的,class是可以多个的

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template