Refactoring, standard, layout _ CSS/HTML

Source: Internet
Author: User
Restructuring, standards, and layout have been a constant debate on standards recently. In fact, some related articles on these issues have been quite clear.

Here is my opinion. There are too many "I think" in this post, which means that I just want to discuss my ideas with you. Maybe there are too many mistakes, so please point them out one by one.

1. My Understanding of web standards
The so-called web standards have been concluded in some tutorials: Structured standards (XHTML, XML), performance standards (CSS, XSLT ?) , Behavior standards (DOM, ECMAScript ). I will not talk about these things here. I only want to talk about my own ideas:

A. The standards are relative and have certain limitations.
As a standard, it is constantly improving. We can also improve it, rather than blindly following it. There is no best, only better. (LeXRus said a while ago that they wanted to set up their own web standard organization. I don't know what's going on now .)

B. standards are only recommended for use. Good standards will be observed by everyone.
We use standards because they benefit us. Just like the ISO9000 standard, it is only advocating and not forced. I think it is useful to me, so I use it; similarly, if you think it is really not good, you can also not use it, the standard itself should not carry any forced. Just like playing basketball, the NBA is a 24-second attack, and we are a 30-second attack. To join the NBA, we have to use other people's rules. We can also join the "World Trade Center". If we are arrogant enough to set up a "World Trade Center" ourselves and release a set of standards, we can also.

C. The standard does not explicitly mention whether to use p or table
Some friends easily equate the standard with "change table to p ". I don't think so, because tables also comply with xml rules. Pages with tables can still be verified by XHTML1.0.

D. "p layout" does not just use p for Layout
We can use all possible labels (including tables) to deploy pages, so as to achieve the best. It is just a new concept. Someone in the jar also said, "It is important to update ideas, not code ." Of course, our ultimate goal is to update the code.

E. XHTML verification is a means, not an aim
Sometimes, we use javascript to generate flash movie code to spoof validator and pass verification. In this way, there is no page that cannot pass the verification. If it's just fun, you can. However, I am afraid that some beginners take validator seriously and even think that passing verification is the ultimate goal. In my opinion, validator is just a tool that helps us check whether our pages comply with standards. In the end, we still have to design our page according to the customer's requirements.
  
2. Why should I use standards?
Some people think that the purpose of using the standard is to achieve the standard. In fact, website reconstruction breaks the ground: to make the website "active" for a longer time, to improve the accessibility of the website, and to reduce costs, we must adopt Web standards! Here there are three "for", none of which is for the standard. The standard is just a means.
After getting started with the "standard", I tried to make some pages that comply with the "standard. At that time, it was not clear why standards were used, but out of curiosity. There were also some problems in the middle, either technically or conceptually. However, I am happy to use p + css to create webpages for customers.
After using the standard, I feel that the code is simplified and the maintenance is convenient.
The code is streamlined to shorten the page loading time. Even under the current broadband condition, we should not relax our requirements-streamline the code (I think this is also the requirement of every programmer ), besides, there are still many dial-up users, as well as those who use mobile phones to access/browse the Internet. This is a competition in seconds.
Higher compatibility can be achieved by strictly following the standards. A qualified Web Page Maker always tries to make the webpage the most compatible. Of course, he wants to strike a balance between effect and compatibility. Just like choosing a husband: You need both money and money.
It is easy to maintain. I even need to modify css to make the whole page show a completely different style. This can save a lot of work.
Of course, I think the most important thing about using standards is backward compatibility. In a professional term: sustainable development. The network is always evolving. A good Web Page Maker must have a certain foresight for future development. Now I know that it will be the world of xml in the future, until something better will replace it.
Every year, too many websites spend a lot of money on the revision to keep up with the times. Because the revision means that everything comes back, including code and even programs.
The standard also requires us to hand over the data to XHTML (or html or xml), and give the performance to css. The two perform their respective duties and combine them.

3. table Smoothing
After the book "website reconstruction" is published, there may be a lot of misunderstandings. Some friends confuse the standards with the reconstruction, or even the same. I have never read this book, so it is hard to evaluate it.
"Without changing the external behavior of the code, you can modify the code to improve the internal structure of the program. I think "website reconstruction" has both the meaning of "p layout" and "web standards. The layout is about a method. The standard is about a specification, which is a matter of two.
The web Standard does not mean that no table is used. I searched for articles on the Internet and did not find an article saying that the web standard is against the use of the table label or even suggested not to use the table label. I think it is like this: instead of using table "layout", we recommend that you use p + cs "layout" instead ".
Taking a data table as an example, I think using table to organize it is the best solution. Of course, you can use other methods to achieve this, but I dare say that there is no simple and concise table. (Maybe, but I didn't find it ?) Of course, in the learning stage, it is quite useful to force yourself not to use tables to solve all problems.

The above is a summary of everyone's thoughts rather than my thoughts. But don't smile. If it is helpful to beginners, it will be Amitabha.

Source: Blue ideal

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.