Day_11. Think of the follow code for newcomers, day_11follow
In the past two days, new people (who have just graduated and have not been in touch with the front-end) cut a page and found some problems, I think that when I first entered the front-end, there were a lot of detours because no one had brought them inevitable, so I took the opportunity to explain it to him, here, we will list the common problems and bad habits on the new users page.
First, go to psd:
First, analyze the most intuitive problems on the page:
Next let's take a look at the Code:
The id name is not standard, and the navigation is written as the banner and the banner is written as the header. Many people may think it is not appropriate if the style and label I wrote correspond to each other? First of all, people will think that you are not professional, and that is, seo does not know the code you write.
I don't know how to use class to define public styles. Every title in the image of little red dot is added.
The background added for the test is not deleted.
Excessive use of position does not understand the relationship between relative and absolute, nor when position should be used. Many new people prefer absolute positioning, as long as I write absolute, adjusting the top and left values will always become what I want. I don't know why the top and left values are so large.
Do not extract public styles. When and when to write them again.
Another common problem is that we like to set the height. No matter what the width and height are, this avoids many problems, but it is fundamentally wrong to do so first, your webpage does not have any scalability. Secondly, there are many problems that you don't have the opportunity to discover because you have set the height, such as floating clearing.
Only the unit of px is used, and sometimes the effect of em is better, such as font indent.
In general, the above problems mainly occur: as people who want to tell the front-end users