The importance of optimizing code in Web Design

Source: Internet
Author: User

Intermediary transaction SEO diagnosis Taobao guest Cloud host technology Hall

Because the network is a constantly changing and evolving organism, so it is very important to build a website that can change and grow with the network, and it is very important that when the network world changes without being hurt by the net shock wave.

Cleaning tags and building web sites with web standards may be confusing, but in the long run it can save time and money.

With the expansion of the network, the technology used in the network is also constantly developing. HTML has existed for a long time in the network, and has produced a lot of derivatives in the course of its continuous development.

The first is JavaScript, followed by CSS, XML, and Ajax. Widespread adoption of HTML5 has been around the corner, Firefox, Safari, Opera and Chrome are HTML5 to support (ie is lagging behind).

In this article, I will take the net billion science and technology www.idccss.com as an example, study the foundation of the network standard, what is it? What does it mean to you? I will point out some very important questions that are very easy to be overlooked in peacetime.

What does a "clean" mark mean?

In short, this means eliminating clutter and making standards compatible and using the same label and structure for different languages.

Clean HTML reduces the use of unnecessary tags, eliminates unwanted items, and completes a task successfully with small tags. It does not use unnecessary attributes, such as built-in CSS, the structure and organization of each file. Similarly, clean CSS should avoid duplication and take advantage of existing resources. Conforming to standards means that your pages conform to the HTML, CSS, and XML standards published by the consortium. It means using the consortium to detect errors, corrections, and tests until your Web page is fully available.

Each website design project has a time limit, and customers want their site to be completed ahead of schedule. So network developers and designers are constantly under constant pressure to improve work speed and efficiency.

I usually think that "thinking fast is going to be sloppy, and it takes a lot of time to mark it in a clean, standard format, and it usually says," It's working, and that's all that matters. "Of course, for now, it's really working for you. But what about next year? What will it be like three years from now? What will happen to new browsers?

Do you really think that search engines will work the same way all the day? You are very picky, if you do not conform to the standard, your surface page level will be reduced.

What happens when someone has to change the page you're editing? What happens if you get hit by a car, hijacked by aliens, and you can't find a camp in a polar expedition? This person must not be able to pick up the mess you left behind, have to spend a whole mind to look at the code, understand the code. Is this going to be a simple thing? Who can guarantee that this person will not see the headache and scold you.

So the first time to do it in the right way to do, this is not a boring thing, this is a philosophy of life. If you do this, you will actually save a lot of time and money and make it easier for people to work with you.

You might think that writing in a built-in CSS would be quicker than writing in a certain way. And you might think it would be quicker to write at random without considering the entire file structure. Later, when you update the file or redesign the site, you will spend more time to make up for the code you have written before, which is far beyond the time you saved. When you write a new page, the annoying inline code you used before will come back and keep you trapped, and you'll spend a lot of time getting out of here.

scalability, accessibility, transformation, and future standards

Mobile browsers are developing more and more promising, and now almost everyone can surf the internet with their mobile phones. Assistive technology is also evolving, such as screen readers designed for the blind, and variable interface devices designed for people with disabilities. You certainly don't want to lose yourself by not taking these changes into account.

For netizens from all over the world, the content on your site may be partially translated into multiple languages. Because of Internet files, Google's cache, and other networking units, the pages you post today may be online for a long time, even if you've removed it from your site.

Clean tags and standards there is still a long way to go to ensure that your site can be smoothly in the future with the network development changes.

What to do and what not to do

Use labels as you think. For example: H1 is the highest level on the Web page, followed by H2, H3 and so on. There should be only one child H1 label on each page.

Name your CSS standards and IDs with meaningful names, and ask yourself what no one else can say from the name. These names are also interesting: #box12 or # comment scale?

Make good use of CSS. For example, if you set a font in a folder, you don't need to reset it in every subfolder unless you want to set a different font in each subfolder. This may make your page open quickly.

Use your HTML, CSS, and XML to revise as many errors as possible. Also pay attention to the warnings generated.

Carefully review the WYSIWYG generated code and make the necessary code cleanup. The code is bloated, redundant, and contains a lot of unwanted, useless rubbish.

Don't inject inline formatting with extraneous tags and attributes because of your haste.

Do not continue to use because of short-term effects, because the use of a page does not mean that his code is in line with the standard, no problem, suitable for search engines.

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.