We know that when a style sheet defines a style, you can define the ID and define class, for example:
Id Method: #test {color: #333333}, calling content on the page
Class method:. Test{color: #333333}, calling content on the page
ID A page can be used only once, class can be referenced multiple times.
Some netizens asked, ID and class as if nothing different, I used in the page with multiple IDs in IE show also normal, with multiple IDs what effect?
Answer: The first effect is the inability to pass the W3 check.
In the page display, the current browser also allows you to make this error, with multiple identical id "under normal circumstances" can also be displayed. But when you need to use JavaScript to control the DIV with the ID, there will be an error.
ID is a label that distinguishes between different structures and content, just like your name, if a room has 2 people with the same name, there will be confusion;
Class is a style that can be set on any structure or content, just like a dress;
Conceptually, it's not the same:
ID is the first to find the structure/content, and then define the style; class is to first define a style and then set it to multiple structures/content.
Web standards want everyone to write code in strict habits,
For example: You can use the display bold, but also can be used to display, but the consortium recommends that everyone use, because more semantic
It doesn't matter if you don't pay attention to these details.
Then you don't have to transition to XML, and you don't need to learn web standards, because Web Standard apps start with changes in these little details, or do you use HTML now?