Beginner: do I write HTML or CSS first when creating a web page?

Source: Internet
Author: User
Are CSS files prepared first or HTML files written first? There are many answers on the Internet: write HTML first and then CSS; write CSS first and then HTML; write both at the same time.
My principle is to write HTML first and then write CSS to control the performance!
For beginners, I suggest writing both of them together. Writing CSS or HTML is not an appropriate method for beginners.
If you want a person to write code, tell him to write HTML first. After writing the code, the HTML cannot be modified, and then you write CSS. If he can write the code, this person must have a very high level of Builder! Therefore, for beginners, I suggest writing them at the same time in most cases. Let's take the following steps:
Define an empty style sheet and connect the HTML page to this external style sheet.
2. Then we first write the most basic layout section in HTML, which uses DIV, and then directly add ID or CLASS to DIV. These layout parts include the coat and header parts, center, left, center, right, and copyright.
3. After writing this, you can write a style in the style sheet, or you can write the layout section. Let's take the header as an example and write the LOGO section in the header, the NAV part is also added with ID or CLASS. Similarly.
Why is it impossible for us to write the HTML part at a time, because people may make mistakes, maybe the process of writing your ideas is wrong, or for the sake of browser compatibility problems, some of them are not expected due to lack of experience, so you may need to modify your HTML code when you find a problem when writing a style. You can also use HTML/CSS at the same time. When writing code, we often write code and test it. It doesn't mean to write a test sentence, but to test the browser after writing a piece of code, I tested IE6 and FF at the same time. A good producer writes a lot of code in most cases before testing it. If they have a lot of experience, they will know and prevent browser error display in advance! So they write code faster than inexperienced people. They have already experienced the errors you want to experience. The first time you encounter a wrong browser, you need to fix the problem, and they can prevent or immediately solve the problem! This is one of the differences between you and them.
Another difference between beginners and Masters is that masters use a large number of shortcut keys. Therefore, you must remember frequently used shortcut keys. Every small detail has been improved, the combination is greatly improved.
In addition, the best way to improve your own level is to practice more. Find some better HTML + CSS templates for encoding practices. You must select a simple one at the beginning and take a screenshot of the page, then, use your own ideas to restore the image to an HTML page!
Related Article

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.