Div and CSS Web making: Beginners use div and CSS Myths

Source: Internet
Author: User
Tags html page modify version versions access

Article Introduction: Beginners Use DIV+CSS structure to write a few misunderstandings of the Web page.

The creation of Web pages for the use of Div and CSS structure to write static page is now very mature, but many new entrants to the use of Div and CSS structure There are many misunderstandings, these myths are also I have experienced and be "old bird" point of correction, so summed up to share with you, I hope to write a page to help.

1, the use of DIV+CSS structure to make static HTML Web page is not tantamount to completely discard the old table. It is not recommended to use table to layout the page because the page loading is very slow to wait for the table structure load completed to see the Web page, followed by the layout of the table does not have a certain semantics, the code to modify the Web page more trouble.

When writing some column block, especially the data classification is more, for example, "Buy Information" column block, the top may appear "publisher, release time, information title, contact" and other items, such as the local recommendations or to use a table to write, because the table is designed to write data tables, control is very convenient, It also meets the semantic requirements, as well as places like Excel data appearing on the page, and is also suggested to write with a table.

2,DIV+CSS structure is not equal to the entire area with div wrapped up. when you encounter a block, you use a div tag, so you write code after the whole is Div, lost the meaning of the existence of value, the block modified is not easy to find, reasonable use of DL, UL, OL, span, and other labels, not only to make your Web page looks clear, and modified very convenient, See the name, such as you want to modify a news list, first find the news list of the div or DL tag, and then find the UL, modify the specific content is very easy.

3, not CSS files must be separated from the HTML code. the reason CSS file and HTML is separated, because some CSS at the same time for multiple page service, and user access CSS files can be slow to exist locally, so the next time you visit other pages without repeated loading CSS, you can save time and traffic, improve access speed, But if your page has some areas of the CSS is unique, other pages can not be used, you do not have to peel out the CSS, directly with the style tag included in the HTML page.

4, with Div and CSS to write the page must be in different types and different versions of the browser to test. It is best to open more than one browser at the same time, if you think your site visitors have not developed the use of Firefox, Google and other browsers habits, that at least compatible with IE6, 7, 8 several versions, due to software restrictions, there is no way to upload a different version of a computer browser, Therefore, with the help of version simulation software, I often use ietest, to test the Web page is enough.

For less experienced page makers, it's best to write a small chunk and look at the effect in different browsers, if there is a problem can adjust the code in time, do not only in one browser test, in a breath, then when you are in the other browser test to find strange Web page when you are crazy (I have done this).

Summary of the main points for the time being so much, the rest is the ability to spell code, the proposed novice or do not use the code hint class software, it is best to write their own complete statement, when you write proficiency you will find that you write code faster than the code prompts faster.



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.