Home >Web Front-end >HTML Tutorial >Further discussion: The benefits of div css to the website_html/css_WEB-ITnose
1. Separate content and form. The frontend of the web page only needs to display the content, and leave the formal art to CSS. The code of the generated HTML file is streamlined, smaller and faster to open.
2. It is simpler and easier to revise the website. There is no need to redesign the layout web page, or even change any HTML and program pages of the original website. You only need to change the CSS file to complete all revisions. For a portal website, revamping is as easy as changing clothes.
3. CSS div makes website revision simpler and easier! There is no need to redesign the layout of the web page, or even change any HTML and program pages of the original website. All modifications are completed by simply changing the CSS file.
DIV CSS revision is as easy as changing clothes for a portal website. When revising, you don’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. Revised. It's convenient. For example, a project I worked on: Funding Company (www.ya-jing.cn), it was red before, but now I changed some codes directly in the css and the overall color became blue, and the width and thickness ratio, etc. All very easy to adjust.
Convenience is convenient, but for a website, I would like to ask if it needs to be updated every month? Or once every six months? I guess there are very few websites that change this frequently. Nowadays, many well-known websites, including industry and portal websites, including personal websites, are updated once a year at most. You change the version once a year, but you only need to rewrite CSS once a year, and the time it takes you to write CSS is one or two times slower than when I use table to create it (if I am technically proficient). Then why should I use CSS? I can achieve the same effect using table. I can complete the table in two minutes. It takes ten minutes for you to write it with CSS.
The website data volume of small and medium-sized webmasters across the country is generally less than 100,000 pieces of data. Now with the automatic batch generation of HTML function, it will only take a few hours to complete the generation. It's only once a year that you need to worry about it, so it's not a big deal.
So unless your website is updated once a month, you’d better use the most skilled and convenient method to implement web design.
Of course, if you have mastered CSS and are a coding geek. You take what I said as nonsense.
4. CSS div website construction separates content and form. The frontend of the web page only needs to display the content, and the formal art is handled by CSS. The code of the generated HTML file is streamlined, smaller and faster to open.
This is the most prominent feature of DIV CSS technology and the root of the existence of CSS. Completely subvert the current traditional (table) web design technology. All content currently produced using tables can be solved using CSS, and the solution will be more perfect and powerful. You don’t need to put tables within tables. You only need to use div within div to achieve all the art of tables within tables. The result is to use div CSS technology to make the generated web page file size more streamlined and smaller. In the table era, it was very common for a page to have more than 10 tables. But now with DIV CSS, a table can be used without even a table, and the previous effect can be completely achieved. This directly leads to a 50% reduction in web page file size compared to when using tables - 80%, which saves webmasters’ hard drive space and makes it faster for visitors to open web pages. Moreover, when using div CSS, unlike when using tables in the past, you have to read all the tables before displaying the page content. Now you can read one page. The div will display an effect, so you don’t have to wait when you open the web page. The benefits are clear and powerful.
This advantage is indeed significant. For web pages built using traditional tables, if there is a lot of content, sometimes it may reach about 30K. When the file is opened, there will definitely be a delay of 0.0 seconds. When using DIV CSS, since there is no table to use, all you see when opening the front desk is the direct content. The CSS files are imported links and are another file. It has nothing to do with the size of the HTML file. The generated HTML file is only one About 10K in size. It is not noticeable when the number of files is small, but when the file size exceeds 10,000, it will still save tens of MB in size.
In fact, these advantages are not very useful now. Why?
Because although the HTML file generated by the table is larger and takes up more space, the current virtual The host space can reach more than 3G for a few hundred yuan. It is completely sufficient for a small and medium-sized portal or website. Even if it is not enough, if the data volume reaches more than 100,000, the generated HTML file will not use 2G. This cost is actually for Small and medium-sized websites can be ignored in the long run. Besides, using table means that the opening speed is slow. This can be ignored in the current network environment. Nowadays, everyone uses broadband to access the Internet, which is at least 512K. A web page is 30K, and it takes less than a second to open. Using DIV CSS is just as fast. 0.0 seconds, which is basically invisible to everyone. And since both generate HTML, the impact on the server is the same. As long as your virtual host network is stable, there will be no difference in table and div css.
However, when using table to create web page frames and tables, they are all made selectively, which means that you don’t need to write code. It is very simple to enter the border and the number of rows and columns to meet the production requirements. However, when using div CSS , it relies entirely on handwritten code. If you write four lines of code for a table, if a page involves the generation of more than ten div tables, the handwritten code will exceed 50 lines. And if you are not good at math or have poor logical thinking ability, you The handwritten form will be a mess, with overlapping forms and completely incorrect positions. Because when using div css to write tables, the logical arrangement of the tables depends entirely on your own handwritten code. If you do not have strong handwritten code skills and logic, the time you spend is at least 4 times longer than the time you spend using table creation. About times. Basically, the ID and class defined on a page will not be less than 20 complete pages. If you write 5 sentences for an ID or class by hand, you will need more than 100 sentences of code to make an HTML page. Of course, many of them can be saved as a CSS. The file is called repeatedly. In other words, if the content of the page is the same and the layout is the same, the link CSS can be directly imported.
This is very similar to creating a web page template when generating HTML. But the time it takes to make this template is several times that of making it with table. Some people have to say here, but when I revise the version, I only need to write another css, and there is no need to generate HTML. Then I have to say that when you write another CSS file revision, I may have already made a page template using a table, and automatically generated HTML pages for the entire site. It's not impossible.