Difference between Class and ID: difference between margin and padding CSS learning notes
Difference between Class and ID: difference between margin and padding CSS learning notes _ experience exchange
Because 99.99% of CMS uses p + css to construct webpage templates, it is forced to be helpless. The hacker needs to learn CSS when he is older. To be honest, he does not think that p is better than table layout! However, as a result of this trend, let's start by looking at what we can learn.
Based on the principle of data and structure separation, CSS should preferably be independent of web files
You are not recommended to directly write CSS code in a webpage file. One advantage of this is convenient modification, and the other is that it is friendly to search engines, and those search engine crawlers can climb up smoothly.
Margin and padding attributes
The margin and padding attributes can be simply understood as the outer and inner margins of elements:
Margin-top, margin-right, margin-bottom, margin-left, padding-top, padding-right, padding-bottom and padding-left
Difference between Class and ID
Simply put, an ID name can only appear once on a page, while a CLASS can appear multiple times. Of course, if an ID name appears twice on a page, the appearance of the opposite page does not affect anything, but does not comply with W3 specifications. A single element, or something that requires program and JS control, needs to be defined by id; elements that are reused are defined by class.
The above is the difference between Class and ID. The difference between margin and padding is the difference between CSS learning notes _ experience exchange content. For more information, please follow the PHP Chinese Network (www.php1.cn )!