Web page acceleration processing - page weight loss and reduction experience skills

  

In ASP we finish talking about the page to lose weight, we must first talk about HTML language, this is an explanatory language, how can you Lose weight, because in the HTML language, there is no need to change lines, not a lot of spaces, but all kinds of HTML written by the editor in order to facilitate the author to view the program, so they use a lot of spaces and line breaks, like FP2000 The software will generate quite a few spaces to make the space inside your webpage very large. There are also some things that can be subtracted are artificial. For example, if you use multiple HTML attributes on an object, and there are duplicates in these attributes, it will make your page fatter. And some different definitions that produce the same effect also produce a lot of useless code! So let's talk about the specific way to lose weight.

1, software compression method

The method of mass content is software compression method, use a software dedicated to HTML weight loss to lose weight on HTML pages (this also says that software is not I did), this method is easy and effective, but it can't be reduced for something like artificial production. 2, design weight loss method

This method is also very easy, here I can only tell you part, more you have to accumulate yourself, the method is to design a web page, especially with a software When designing a web page, you need to use a good operating habit and the right way to optimize the amount of pages you write. How to do it? I have some examples below: for example, when you have text or images that need to be centered in a table, then using cells in the middle will result in less code than using text centering; for example, if all the text in your page is small, you use CSS methods to define text will generate a lot less code than a part of the text to write a word; for example, if you want to define a line in a table to define the same color, then using the line definition will be better than using the unit. The grid defines the color to produce less code; for example, if most of the links in your page are to open a new window, then you set the page's ink to open a new window, which will reduce the number of new windows. definition. There are a lot of things in this area, and you need to accumulate yourself. Rainbow rain has accumulated a lot of things to write on …… This method is to have a good habit, so that not only will not increase your work, but also "how to lose weight." 3, program weight loss method

This is the higher entry point of the page weight loss, we can see that there are a lot of code in the page is the same, these same things can be reduced if you can It’s awful, how can I do that? The program is used, because now the web page can use a programming language JavaScript. This program is inserted into the HTML to complete some things, so we use it for weight loss. For example, the HTML of the link is as follows: <TD align = middle width = 110 & gt; & lt; a href = " http: //rongww.yeah.net" & gt; Yung children home & lt; /a & gt; & lt; /TD & gt; & lt; TD align = middle width = 110 & gt; & lt; A href = " http: //hdqs.126.com" & gt; beans emotion & lt; /A & gt; & lt; /TD & gt; & lt; TD align = middle width = 110 & gt; & lt; A href = " http: //stonetime.126.com">Stone Time</A></TD><TD align=middle width=110><A href="http://xiaokuen.on.net.cn" ; & gt; love garden & lt; /A & gt; & lt; /TD & gt; & lt; TD align = middle width = 110 & gt; & lt; A href = " http: //lilicai.yeah.net" & gt; flavor & lt; /A & gt; & lt;; //broy.126.com" & gt; wind flower & lt; & gt /a /TD & gt; many content of: & lt; /TD & gt; & lt; TD align = middle width = 110 & gt; & lt;; a href = & quot http , but there are quite a few things that are the same, then Rainbow Rain uses programs to dynamically generate these things. As follows: & lt; script & gt; function lk (url, txt) {document.write (" & lt; TD align = middle width = 110 & gt; & lt; A href = " + url + " & gt; " + txt + "</A></TD>")}lk("rongww.yeah.net","<font color=red>who's home")lk("hdqs.126. Com","red bean affection")lk("stonetime.126.com","Stone time")lk("xiaokuen.on.net.cn","love garden")lk( "lilicai.yeah.net","Taste")lk("broy.126.com","windflower")</script>how, the content is less, but if it seems like the above There are a lot of links, you can use this app to lose weight a lot, and increase the modifiability of your page. This app is just an example, maybe it doesn't suit your needs, but this is the way I tell you. You can design the programs you need to make your pages faster and better. Here is a way to lose weight with the program is to use the .js program, the last time I said that the improper use of .js will slow down your page, but if you use it properly, your local .js will be another It is ergonomic. It can save the same thing in different web pages with a .js file, which makes your page easy to reduce, and also facilitates future page modification. Ok, I wrote a lot. I want to read these. You have a certain understanding of the acceleration of the webpage. Of course, maybe the network is getting faster and faster, everyone is no longer paying attention to it, but now most of the friends are still Use the era of cats online, it is necessary to reduce weight loss for your own web pages. Then friends, goodbye, have time to look at the website of Hongyu. Here, the website of Hongyu is actually used. Hongyu welcomes you.

Copyright © Windows knowledge All Rights Reserved