Use the neat HTML tag to construct the webpage _ HTML/Xhtml _ webpage Creation

Source: Internet
Author: User
The Network is a constantly evolving organism. It is important to build a page that can adapt to the Internet development for a long time. It can be a rapid follow-up of your website in the rapids of Internet development. Building standard-compliant pages with neat HTML tags can help you do this. More importantly, it can save a lot of time and money in future operations. The Web technology is a constantly evolving organism with the network. It is very important to build pages that can adapt to the development of the Internet for a long time, it can be the rapid follow-up of your website in the development of the Internet.

Building standard-compliant pages with neat HTML tags can help you do this. More importantly, it can save a lot of time and money in future operations.

The web page technology is advancing along with the development of Internet technology. HTML technology has been developing for a long time and its associated technologies have also developed steadily.

The first is Javascript, followed by CSS and XML, until now AJAX, the large-scale use of HTML5 has also begun to emerge-Firefox, Safari, Opera, and Chrome have basically fully supported HTML5 (on this issue, microsoft's Internet Explorer once again hinders Internet Development #-_-)

In this article, we will discuss basic web standards, what they are, what they mean, and solutions to these important but often overlooked problems.


What is the "clean" HTML Tag?

Simply put, the "clean" HTML Tag refers to the use of meaningful tags and structures that are not cumbersome, compliant with standards.

No cumbersome HTML code can fully utilize tags, eliminate unnecessary code, and only save meaningful tags. It avoids useless attributes, such as embedded CSS, and keeps the document structure neat.

Similarly, no cumbersome CSS code should avoid repeated use of inherited attributes (remember that CSS is intended to cascade style sheets), and reuse CSS Class scientifically.

Compliance means that your page can pass W3C HTML, CSS, and XML standard verification, use the free W3C validators to identify and modify errors, and continue testing to learn that 100% complies with the standard.


Why? Is it enough to display normally?

Each project has an urgent time limit, and users want the website to be released as soon as possible. Therefore, website developers and designers are required to complete their work quickly and efficiently.

It is easy for people to fall into a trap-"quick" means being sloppy. It is a waste of time to write neat and compliant code. Some people often say: "It is displayed normally, so there is no problem ".

Although it is shown at this moment, what about next year? Three years later? What should I do with browser replacement? Is the device compatible?

Do you really think that the search engine will repeat your code in a row? They are very picky. If you do not use standardized code, it is equivalent that you ran the search engine on your own.

What if other employees modify your code? What if you are fired by the boss or you change your job? There will be successors to see your code and understand what they mean. Do you want to make this simple, or do you want him to hide your villain in the back?

It is not an annoying thing to start writing it correctly. It will save you time and money and give you less worries.

You may think that using embedded CSS to write pages is faster, or you may think it is more convenient to directly write HTML without considering the structure.

However, when you modify a document or modify a website in the future, you will spend more time to make up for the interference caused by poor code. If you create a new style sheet, the embedded CSS dispersed in HTML code will cause you a lot of trouble, and you may spend hours to strip them out.


Scalable, device-friendly, semantic, and easy to upgrade

Mobile browsers are growing faster and faster, and mobile Internet access is no longer a blackberry patent. Today, hundreds of millions of people are using mobile phones to browse webpages every day.

It is already common to have devices that develop secondary browsing technologies for people with visual impairment or that have special operation interfaces designed for people who are physically inconvenient. If you don't want to lose such a large user base, consider device-friendly issues.

Your website may be provided to users in the form of Braille. With tools such as Internet content storage and Google snapshots, even if your webpage is deleted, it may also be retained on the network for a long time.

The use of clean and compliant tags allows you to easily cope with the above situations.


Do and Don't ("yes" and "no ")

DO-use predefined labels. For example, h1 is the most important part of a webpage, followed by h2, h3, etc. A webpage can only contain one h1;

DO-Use meaningful element names. Ask yourself if someone else reads the code, will you understand the meaning of your class and ID name, for example, the same layer, using # box12 or # comment-footer, which one do you think is better?

DO-make full use of the inheritance of CSS. For example, if you set the font attribute in a iner, you do not have to set it in its child elements unless it uses different fonts. This will make your style sheet clear and concise.

DO-Make your HTML, CSS, and XML Code conform to the standard. Use W3C validators to verify errors and warnings and modify them to know that 100% complies with the standard.

DO-two-way check the code generated by WYSIWYG editor. What you see is that the resulting browser is the biggest part of the spam code. You must try to streamline the code generated by the browser.

DON't-do not use embedded css styles and irrelevant tags and attributes. If you are busy in time, do not add these things.

DON't-do not be satisfied with "display correctly ". Because the error hidden in the page may make the page invisible in other browsers or devices.

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.