[CSS basic knowledge] in the CSS ID and the distinction between Class
Related Tags:
(Http://www.8go8.com/blog/post/20060612013036.html)
This distinction between the two are relatively easy to confuse the issue, especially with the class ID, I believe many people do not have a detailed understanding of the distinction. Following is my understanding:
1.Class and the difference between a Class id is used according to user-defined criteria for one or more elements of a definition. Make a more appropriate analogy is the scenario: a Class can be defined in each script the story line figures, you can CSS, Javascript, and so the use of this class. Therefore you can use on a page in the class = "Frodo" class = "Gandalf" class = "Aragorn" to distinguish between the different story lines. Another point is very important in a document you can use any number of Class.
As for the ID, usually used to define a page only once markings. In the page layout of the structural layout (for instance, a page is usually a header from a header
Summed up in one sentence: Class can be repeated use of ID in a page can only be used once. Most likely in a browser repeatedly use the same ID will not be a problem, it is the standard, this is the wrong use, but is likely to lead to some real problems of the browser. (Just in Dreamweaver tried to, and indeed, there is no error)
In practical applications, the text of the Class may be more useful, such as typesetting, and ID is on the macro layout and design at various elements more useful.
Padding 2.Margin and replace the distinction between the two forms are the most important role -> block segmentation good way Margin is the difference between the different Tag isolated from each other and Padding is the same elements of the different aspects of the use of segmentation, which most clearly seen in the table. Particularly when the load on the Background of a regional style, the content of Padding under the background Color will be changed, and Margin will not be changed.
- Flash ActionScript Filter Class 8 entry filters
- Id different definition of the class with css
- Div ? ? ? ¨°
- Based on the unlimited class menu Ajax
- The Flash ActionScript Record Second Class
- CSS selector: the distinction between class and ID!
- Flash AS3.0 class and bonding
- AJAX technology (2) common class
- Flash will be converted into the internal XML object class
- Ajax controls and class libraries Analysis
- DIV
- Div + CSS page layout: class portfolio realized
- Id with the class structure of principles and the use of skills
- Div CSS page layout: class portfolio realized
- Application of the same element of a number of priority class test!
- XHTML structure of the class id and the use of principles and skills
- Understand CSS class class and logo id selectors
- CSS Guide Intermediate class and id selectors
- CSS achieve unlimited-class menu
- Id and class distinction




