Currently, 99.99% of CMS uses Div + CSS to construct webpage templates, which is helpless. When the hacker is older, he still needs to learn CSS. To be honest, he does not think that DIV 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
CopyCodeThe Code is as follows: <LINK rel = "stylesheet" type = "text/CSS" href = "../XXX/web.css"/>
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 attributes of margin and padding can be simply understood as the margin and padding 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. Single element or needProgramAnd js-controlled things need to be defined by ID; reuse elements, defined by class.