Page speed processing-page weight loss and reduction

Source: Internet
Author: User
Tags define definition html page
In the ASP, we have to finish speaking of the page of the weight loss will first speak the HTML language, this is an explanatory language, that how can "lose weight" it, because
For the HTML language would have been without a newline, not a lot of space, but the various editors with the editor of the HTML to facilitate the author to view the program so it is used
A lot of space and and line, as if FP2000 this software will produce quite a lot of space to make your web page of the inner space becomes very big. There are some things that you can subtract.
Artificial, for example, you use multiple HTML attributes on a pair of pixels, and these attributes are duplicated, which makes your page fat. And some can produce
The same effect of different definitions also produced a lot of useless code yo! So let's talk about specific ways to lose weight.

1. Software compression method
The method of content is the software compression method, with a special HTML software to lose weight on the HTML page (it also says that software is not what I do
), this method is very easy and effective, but for example, the human-generated things can not be reduced.

2. Design Weight Loss Method
This method is also very easy, here I can only tell you a part, more you have to accumulate, the way is to design the page, especially with a
Software to design the Web page you need to use a good operating habits and the right way to make you write the page volume optimization. How do you do it specifically? I have some below
Example: For example, when you have text or a picture that needs to be centered in a table, using a cell centered is less code than using the center of the text;
All the text is in the small print when you use the CSS method to define the text will be more than a part of the text to write a lot less code; For example, say you want to
By going to a row in a table to define the same color, using a row definition would be less code than using a cell-defined color; For example, if your page is large
Most of the links are to open a new window, then you put the page's ink to open a new window, which will reduce the number of new windows to open the definition. That's a lot.
Many of these things, it needs to accumulate your own it, rainbow rain accumulated a lot to be written on ... Hehe The way to do this is to keep you in a
Good habits, so not only will not increase your work and can "lose weight" how good ah.

3. Program Weight Loss Method
This is the high level of the page to lose weight into the world, we can see that the page has a lot of code is like, these kind of things if can be reduced to
How do you do that? With the program, because now the Web page can use a program language JavaScript this program is inserted into the HTML to complete
Some of the things that move too much, then we use it for weight loss, such as the HTML to do the link as follows:
&LT;TD align=middle width=110><a href= "http://rongww.yeah.net" > Home </A></TD> of Banyan son
&LT;TD align=middle width=110><a href= "http://hdqs.126.com" > Red bean Emotion </A></TD>
&LT;TD align=middle width=110><a href= "http://stonetime.126.com" >stone time </A></TD>
&LT;TD align=middle width=110><a href= "http://xiaokuen.on.net.cn" > Love garden </A></TD>
&LT;TD align=middle width=110><a href= "http://lilicai.yeah.net" > Taste </A></TD>
&LT;TD align=middle width=110><a href= "http://broy.126.com" > Wind flower </A></TD>
A lot of content, but there are a lot of things are the same, then rainbow rain on the use of programs to dynamically generate these things program as follows:
<script>
Function lk (url,txt) {
document.write ("<td align=middle width=110><a href=" +url+ ">" +txt+ "</A></TD>")
}
LK ("Rongww.yeah.net", "<font Color=red> 's Home")
LK ("hdqs.126.com", "Red bean Emotion")
LK ("stonetime.126.com", "Stone Time")
LK ("xiaokuen.on.net.cn", "Love Garden")
LK ("lilicai.yeah.net", "flavor")
LK ("broy.126.com", "Wind Flower")
</script>
How, the content is less, but if it seems to have a lot of links above, use this program can be a lot of weight loss for you, and added to your page
Modifiable, this program is just an example, maybe it doesn't fit your needs, but that's the way I tell you, you can design the program you need to make your
The page is faster and better. Here to tell you a way to lose weight with the program is the use of the. JS program, last said. js usage will make your page speed
Down, but if you use it reasonably, your own local. JS is otherwise ergonomic. It allows you to save the same thing in a. js file on different pages so that you
Easy to reduce the page, but also easy for your future page changes.

Well, wrote a lot of, I want to see these you have a certain understanding of the acceleration of the Web page, of course, perhaps after the network more and more quickly, we all no longer note
Yes, but now most friends are still using the "cat" internet era, it is necessary to lose weight for your own web page. So, friends, goodbye,
Have time to see the Rainbow Rain website, here said, Rainbow Rain website on the real use, rainbow rain welcome you AH.


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.