Day_11. Think of the follow code for newcomers, day_11follow

Source: Internet
Author: User

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

     

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.