Misunderstandings about using div + css structure to write web pages for beginners

Source: Internet
Author: User

Currently, it is very mature to write static pages with div and css structures during webpage creation. However, many new users still have many misunderstandings about using div and css structures, these misunderstandings are also the things I have experienced and have been corrected by the "old bird". So I would like to summarize them and share them with you, hoping to help you write web pages.

  

 

1. Using a div + css structure to create a static html webpage is not equivalent to completely abandoning the Ancient table Writing Method. We do not recommend that you use table to deploy a webpage because the webpage can be viewed only after the table structure is loaded slowly. Second, the table layout does not have certain semantics, modifying webpage code is troublesome.

When writing some section blocks, especially those with a large number of data categories, such as the "purchase Information" section, there may be items such as "publisher, release time, information title, and contact information" on the top, we recommend that you use tables to write data like this, because tables are specially used to write data tables, which are easy to control and comply with semantic requirements, we also recommend that you use table to write data similar to excel Data on the page.

2. The div + css structure is not equal to that of the entire area. When you encounter a block, you can use a div label. After you finish writing the code, the entire article is a div. The Semantic Value is lost and the block cannot be easily modified, the rational use of dl, ul, ol, span, and other labels not only makes your webpage look clear, but also makes it easy to modify it. For example, if you want to modify a news list, first, find the div or dl tag of the News list, and then find the ul in it. It is easy to modify the specific content.

3. Not css files must be separated from html code. The reason why css files and html are separated is that some css services serve multiple pages at the same time, and css files can be cached locally during user access, in this way, you do not need to repeatedly load css when accessing other pages next time, which can save time and traffic and increase the access speed. However, if css in some areas of your page is unique, if you cannot use other pages, you do not need to strip out css. You can use style labels to include them in html pages.

4. To write web pages using div and css, you must test them in different types and versions of browsers. It is recommended that you open multiple browsers at the same time. If you think that your website visitor has not developed the habit of using Firefox, Google, and other browsers, you must be compatible with ie6, 7, and 8 versions at least, due to software restrictions, there is no way to install multiple browsers of different versions on a computer. Therefore, I often use ietest to test web pages.

For less experienced page makers, it is best to write a cell block and take a look at the results in different browsers. If there is a problem, you can adjust the code in time, instead of testing it in a single browser, writing it in one breath, so when you test other browsers and find the webpage strange, you get crazy (I did that once ).

The summary points are so much for the time being, and the rest is the skill of spelling the code. It is recommended that new users do not use code-prompting software. It is best to write complete statements by themselves, when you are proficient in writing, you will find that you write code faster than the code prompts.

Author: Sun Fei, Jianghu http://www.sunfei.net)

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.