With the advent of the Web 2.0 era, the entire Internet website is undergoing a technical update, the so-called "website refactoring". The simpler point is DIV + CSS for website production. If Tianchang Company, which had its own corporate website as early as 2005, will definitely find that its corporate website is definitely a table layout, because the CSS standard was issued in February 2005. With the improvement of the CSS standard, CSS is powerful Functionality and ease of use are gradually being realized. This article of Tianzhan will introduce our current Tianchang website construction. Why do we use DIV + CSS?
Let's briefly list the benefits of using DIV + CSS:
1. The content and form are separated . The front page of the webpage only needs to display the content. Generated HTML files are streamlined, smaller and faster to open.
2. It's easier and easier to revise the website . You don't need to redesign the layout of the webpage or even any HTML and program pages on the original website. You only need to change the CSS file to complete the revision. For a portal, it's as easy as changing clothes. Remember the skinning function in the upper right corner of hao123? This is how it works.
3. The later maintenance is very convenient .
The above three points are the most prominent of the N benefits. I will detail these three points:
1. The content and form are separated. The front page of the webpage only needs to display the content. Generated HTML files are streamlined, smaller and faster to open.
This is the most significant feature of DIV + CSS technology and the root of CSS. Completely subvert the traditional (table) web design technology. All the content made with table can be solved with CSS, and it is more perfect and more powerful. You don't need everyone to form a table, just use DIV to DIV to achieve all the art of the previous table, so the result is to use DIV + CSS technology to make the generated webpage file size smaller and smaller. In the table era, it is very common for a page table to have more than 10 tables, but now with DIV + CSS, a table can be used without it, which completely achieves the previous effect. This directly results in a 50% reduction in the file size of a web page compared to the use of a table. -80%, which saves the hard disk space of your webmasters. The visitor opens the webpage faster, and when using DIV + CSS, unlike when using the table in the past, all the tables must be read before the page content is displayed. It is now possible Reading a DIV will show an effect, you do not have to wait to open the webpage. The benefits are really obvious and powerful.
This advantage is indeed significant. For any webpage built using traditional tables with a lot of content, it is sometimes possible to reach about 30K. When the file is opened, there must be a delay of 0.0 seconds. With DIV + CSS, because there is no form to use, all you see in the front desk is direct content. The CSS file is an import link. It is another file. It has nothing to do with the size of the HTML file. Just about 10K in size. When the number of files is small, it can't be seen, but when the file is more than 10,000, it will still save tens of megabytes.
In fact, these advantages have been brought to the present. Personally, I feel that they are not very useful. Why?
Because the HTML file generated by the table is larger and occupies more space, the current virtual hosting space can reach more than 3G for a few hundred dollars. A small or medium-sized portal or website is completely sufficient, even if it is not enough, your data The amount reaches more than 100,000 levels, and the generated HTML file can not use 2G. In fact, this cost is completely negligible for small and medium-sized website managers. Besides, using a table means slow opening. In the current network environment, this can be ignored. Now everyone uses the Internet for broadband, at least 512K or more, a web page 30K, when opening less than a second, using DIV + CSS is faster So 0.0 seconds, which is basically invisible to everyone. And since both generate HTML, the effect on the server is the same. As long as your virtual host network is stable, there is no difference between table and DIV + CSS.
However, when using tables to make web frames and tables, they are all made by choice. That is to say, you do n’t need to write code. You can easily enter the border and the number of rows and columns to achieve the requirements. However, when using DIV + CSS, It is written by hand. If you write four lines of code on a form, if a page involves the generation of more than ten DIV forms, the handwritten code will exceed 50 lines. If you have poor math or logical thinking ability, you can write it out by hand. The tables will be messy, with overlapping tables and incorrect placement. Because when writing a table with DIV + CSS, the logical arrangement relationship between the tables is completely determined by your own handwritten code. If you do not have strong handwriting code ability and logic, the time you spend is at least longer than the time you use to make the table. About 4 times. Basically, there are no less than 20 IDs and classes defined for a page. There are no less than 20 complete pages with an ID or class. You will have more than 100 lines of code when you make an HTML page. Of course, many of them can be saved as a CSS. File to call repeatedly. In other words, if the page content is the same, you can directly import the link CSS to achieve the same layout.
This is much like making a web template when generating HTML before. But the time it takes to make this template is several times longer than when using a table. Here are some people to say, but when I am revising, I only need to write another CSS, and no longer need to generate HTML. If you say "when you write another CSS file revision, I may have used table to make a page template, and also automatically generate a HTML-wide page", this is probably the only thing you believe.
2. It's easier and easier to revise the website. You don't need to redesign the layout of the webpage or even any HTML and program pages on the original website. You only need to change the CSS file to complete all the revisions.
DIV + CSS is as simple and easy as changing clothes for a portal site. When changing, you do n’t need to change the entire site's HTML page. You only need to rewrite the CSS and then overwrite the previous CSS with the new CSS. Remember the skin change function on hao123 homepage? In fact, he just wrote a few different styles of CSS, which CSS you call on the skin you want, so that you can change the skin without refreshing.
Business website owners who use form layouts will definitely encounter someone asking you to change a template for you, but they are rejected. The reason for rejection is "form maintenance is very difficult." This is indeed the case. Just as our customers in Tiantian, some of them already have a corporate website, but when we help to modify it, we are also very difficult. The complexity of the table layout is not as simple as dragging and dropping, and it will Browser compatibility takes a lot of time, so we recommend our customers to restructure the corporate website, and this is also the basic requirement of the web2.0 era. Moreover, if you and your website construction and design service provider terminate the cooperation relationship for some reason, you can easily modify the website functions with other service providers, and the cost is very small, which is exactly what DIV + CSS is. General technology, there will be a lot of people, more people will no longer study backward table layout technology.
Link to this article: Why use DIV + CSS to build Tianchang website?