The Internet is an ever-changing organism. It is very important to build a page that can adapt to the development of the Internet for a long time. It can be a rapid follow-up of your website in the torrent of the development of the Internet.
Using neat HTML tags, building standards-compliant pages can help you do that, and more importantly, it can be a huge amount of time and money savings in your future operations.
Web page technology has been progressing with the development of Internet technology. HTML technology has been developing for a long time, and its companion technology has also developed steadily.
First is Javascript, then CSS and XML. Until now AJAX, the large-scale use of HTML5 has begun to emerge - Firefox, Safari, Opera and Chrome have basically fully supported HTML5 (on this issue, Microsoft's Internet Explorer once again hinders the development of the Internet #-_-)
In this article, we will explore basic web standards, discuss what they are, what they mean, and solutions to these important but often overlooked problems.
Simply put, neat HTML tags refer to: no burden, comply with standards, and use meaningful tags and structures.
No cumbersome HTML code can make full use of tags, eliminate unnecessary code, and save only meaningful tags. It avoids useless properties, such as embedded CSS, and keeps the document structure neat.
Similarly, CSS code without cumbersome should avoid its own duplication, use inheritable properties (remember that CSS is intended to be a cascading style sheet), and scientifically reuse CSS Class.
Complying with the standards means that your page can be verified through W3C's HTML, CSS, and XML standards. Use the free W3C validator to find and modify errors, and continue to test to know that 100% complies with the standards.
Every project has a tight time limit, and users hope that the sooner the website is released, the better. Therefore, both website developers and designers are required to complete the work quickly and efficiently.
It is easy for people to fall into a trap - fast means sloppy, and writing neat, standard-compliant codes will waste time. People often say: If it is displayed normally, there will be no problem.
Although it shows at this moment, what about next year? What about three years later? What to do if the browser is replaced? Is the device compatible?
Do you really think search engines will pick your code line by line? They are very picky. If you don’t use standardized code, it is equivalent to driving away the search engine yourself.
What happens if there are other employees who modify your code, what happens if you are fired by your boss or change jobs by yourself? 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 stab your villain behind his back?
Start writing it correctly, it is not an annoying thing, it will save you time and money and make you less worries.
You may think that using embedded CSS is faster, or you may think that writing HTML directly without considering the structure is more convenient.
But when you modify the document or you want to revise the website in the future, you will spend more time making up for the interference caused by inferior code. If you build new stylesheets, embedded CSS scattered in HTML code can cause you a lot of trouble and you may spend hours stripping them.
Mobile browsers are developing faster and faster. Mobile Internet access is no longer BlackBerry's patent. Now hundreds of millions of people use their mobile phones to browse the web every day.
Devices with assisted browsing technology developed for people with visual impairment or special operating interfaces designed for people with physical inconvenience are already common. If you don't want to lose such a large user base, you have to consider device-friendly issues.
Your website may be provided to users in Braille. With tools such as Internet content storage and Google snapshots, your web page may be retained on the Internet for a long time even if it is deleted.
Using neat, standard-compliant markings can make it easy for you to deal with the above situations.
DO - Use predefined tags. For example: h1 is the most important part of a web page content, then h2, h3, etc. There can only be one h1 in a web page;
DO - Name with meaningful elements. Ask yourself if someone else reads the code, will you understand the meaning of your class and ID naming. For example, for the same layer, use #box12 or #comment-footer, which one do you think is better?
DO - Make full use of CSS inheritance. For example: if you set the font attribute in a container, you don't have to set it separately in its child elements unless it uses a different font. This will make your style clear and concise.
DO - Make your HTML, CSS, and XML code compliant with the standards. Use the W3C validator to verify errors and warnings and modify them to know that they are 100% compliant.
DO - Two-way check the code generated by the WYSIWYG editor. The WYSIWYG browser is the big header that generates junk code, and it is necessary to try to streamline the code it generates.
DON'T - Do not use embedded css styles and irrelevant tags and properties. You are very busy in time, so don’t add these things at will.
DON'T - Don't be content with displaying correctly. Because errors hidden in pages may ruin the page in other browsers or devices without recognizing it.