Improve Web page access speed by optimizing HTML code for Web pages

Source: Internet
Author: User
Tags count html page key words php and access
Visit | speed | website | optimization

First, do not put the entire page into a table

Generally, we are using a table layout, the entire content of the page into a table (table), and then by the cell TD to divide the layout of each "block", the display speed of this site is absolutely slow. Because the table to wait for all the contents are loaded after the display, if some content is inaccessible, it will delay the entire page access speed. In the layout of the whole page into three parts, head top, Central middle, copyright (tail) Bottom, the middle of the best more points, because, now everyone's home is generally divided into several columns of content, in fact, can be divided into open, not all crammed into a table. Use a few more table, especially the code of the Ad League, and try to put it in a separate table; Slow ad code, put it directly to the bottom with a table. Anyway, the people who visit the most concerned, the first to see is not copyright information.

second, do not put too large flash animation, pictures , can be used in GIF format without JPG. The big picture is best cut into several pieces and then spell.

third, as far as possible with static HTML page , less JavaScript special effects, sometimes too much, but make everyone dizzy, previously saw a station, the status bar text replacement Crazy fast, has been flashing AH flash. Not much necessary, others are to look at the station of the article, mm pictures. Not to see special effects, of course, appropriate to do a few or can, at least in front of the Super rookie show their ability to let them worship under.

Four, the ASP, PHP and other documents to the access to. JS Reference

If you want to embed dynamic data in a static HTML page, and the dynamic data is provided by a program such as ASP, each time a person visits your site, The server will execute and process a count.asp file, extract the corresponding data from the database, and then output to the Web page display, if tens of thousands of people visit at the same time, it is necessary to perform tens of thousands of times. It is recommended that you dynamically generate data into a count.js file in these programs, and then use the code to refer to the. js file on the home page. In this way, the data display task to the client browser to do, will not consume the resources of the server, the display speed naturally faster.

Five, the use of iframe--this we all know, a lot of GG is such a hair OH
Use an IFRAME so that it doesn't drag the entire front page display because of the delay in advertising pages.

Six, the Counter code placement

Directly put the statistics code in front of the page content, or in a table or div tag, then when the counter can not access, your page that table or Div will produce a few 10 seconds delay, resulting in a long time to access the page. The right approach is to put the statistics code at the bottom of the page and not with the page content in a table or div tag. You can place the statistic code directly at the bottom of the page code, or make a table or div to place the counter separately.

Seven, friendship links

Many people like to refer directly to the image URL on the friendship site, so that the picture must be loaded before the display, the access speed of each friendship site is not the same, the entire form must wait for the picture

Can be displayed after downloading, this greatly reduces the speed of the Web page, sometimes may be a few red fork (by d? The space is hung up. OH). In fact, the best logo is to download before uploading to their own web page space.

The best is the text link: feel more tidy, in addition, as far as possible and peer website Exchange connection, some of these words can be linked up, as their own station keyword. For example: You are a student station, the other station's name is "* * University Student Forum", can write such:< A href= "..." >** University </a>< a href= "..." > Student </a>< a Href= "..." > Forum </a>, this does not affect link, but also highlighted the keyword.

Finally say a few SEO, yesterday on the Internet to see

The key words have the following several parts mainly:

Title Tag:< title> Text </title>

META Tags:

< META name= "Description" content= "Web page brief" > < meta name= "Keywords" content= "keyword" >

Large title Tag:< h1> Text

Link tag:< A href= "http://yourcompany.com/page.htm" > Text </a>

Page body:< body> Text </body>

ALT tag: < IMG src= "http://www.webjx.com/htmldata/2007-05-25/1.gif" border=0 alt= "keyword" >

Comment Mark:<!--text-->

Input tags:< input type= "HIDDEN" name= "HIDDEN" value= "keywords" >

URL: http://www. keyword. com/keyword. htm

Just give it to the code.

When it's not optimized

<table cellspacing=0 cellpadding=0 border=0>
<TBODY>
<TR>
&LT;TD align=middle width= "100%" colspan=3><table cellspacing=0 "cellpadding=0 width=" 100%
<TBODY>
<tr height=4>
&LT;TD width=7></td>
&LT;TD width=* background=http://www.webjx.com/htmldata/2007-05-25/images/fk_top_bg.gif></td>
&LT;TD align=right width=7></td>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
&LT;TD align=middle width= "100%" colspan=3><table cellspacing=0 "cellpadding=0 width=" 100%
<TBODY>
<TR>
&LT;TD width=4 height= "100%" ><table height= "100%" cellspacing=0 cellpadding=0 width= "100%" border=0>
<TBODY>
<TR>
&LT;TD background=http://www.webjx.com/htmldata/2007-05-25/images/fk_left_bg.gif></td>
</TR>
</TBODY>
</TABLE></TD>
&LT;TD align=middle width=*><a href= "#" target=_blank></a></td>
&LT;TD width=4 height= "100%" ><table height= "100%" cellspacing=0 cellpadding=0 width= "100%" border=0>
<TBODY>
<TR>
&LT;TD background=http://www.webjx.com/htmldata/2007-05-25/images/fk_right_bg.gif></td>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
<TR>
&LT;TD align=middle width= "100%" colspan=3><table cellspacing=0 "cellpadding=0 width=" 100%
<TBODY>
<tr height=4>
&LT;TD width=7></td>
&LT;TD width=* background=http://www.webjx.com/htmldata/2007-05-25/images/fk_end_bg.gif></td>
&LT;TD align=right width=7></td>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>

*********************

After the optimization

<table border= "0" id= "table1" cellpadding= "0" style= "border-collapse:collapse" width= "1" height= "1" >
<tr>
&LT;TD width= "4" height= "4" ></td>
&LT;TD height= "4" ></td>
&LT;TD height= "4" width= "4" ></td>
</tr>
<tr>
&LT;TD width= "7" ></td>
&LT;TD align= "center" > </td>
&LT;TD width= "7" align= "right" ></td>
</tr>
<tr>
&LT;TD width= "4" height= "4" ></td>
&LT;TD height= "4" ></td>
&LT;TD width= "4" height= "4" ></td>
</tr>
</table>



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.