In CSS, we are common to the selector class, then for class usage and specification, we will make a summary:
About the 1.CSS Id and class selector
ID and Class Selector
If you want to set CSS styles in HTML elements, you need to set the "id" and "class" selectors in the element.
ID Selector
The ID selector can specify a specific style for an HTML element that is labeled with a specific ID.
The HTML element sets the ID selector with the id attribute, and the ID selector in the CSS is defined as "#".
The difference between 2.a.class and A. Class, note the space-CSS debugging tips
This problem occurs when using picture sprites to position images, and sometimes a space can cause a lot of problems, this article introduces the difference between A.class and Class A.
3. The principle of using both ID and class in CSS
First, describe the difference between ID and class:
The ID is a label that distinguishes between different structures and content; The ID is the structure/content that is first found, then the style is defined, and the class is a style that can be set on any structure or content; class is defined as a style and then set to multiple structures/content.
4. Introduction to common naming conventions for page layouts class
This article is mainly for everyone in-depth analysis of the page layout class common naming norms related data, with a certain reference value, interested in small partners can refer to
What is the difference between 5.id and class, using class or ID
In the previous two articles we talked about the knowledge and how to use class and ID, but how do we choose the class or ID in the actual project?
First look at the difference between the two!
ID is unique and class is universal, so a page can only be used once for the same ID, and class can be used without restrictions.