How does the website code optimize?

1. h label 2. Bold label 3. IMG tag 4. NOFOLLOW Tag 5. DIV Tag 6. Table Tag 7. CSS Optimization 8. JS Code Directory

In SEO optimization, many small partners don’t understand the code and completely ignore code optimization. This is wrong; in fact, website code optimization is also a very important detail, and many SEO masters use their important means to optimize the website! How does this article talk to the website code together?

1. h tag

H tag, used to mark the tag of the article title, divided into H1 ~ H6, stand in SEO, the intensity of this 6 labels is successfully weakened, so the weight of the H1 tag is the highest, must be written, often suggesting that the page title is consistent It is best to include keywords; there are still a few things to pay special attention: 1. A page has only one h1 tag; 2. There is an H2 tag, there must be H1 label; there must be H1, H2 label, Such push.

2. Bold label

There are 2 labels with bold results in HTML, one is a strong tag, one is a B tag. What is the difference between the two? The STRONG label is more emphasized than the B tag; and the B tag is just a simple bold. Under normal circumstances, you have to emphasize that a keyword is used to use the strong tag. If it is just to simply add a word or sentence, use a B tag.

3. IMG tag

The IMG tag is a picture tag, often requested to write the four elements of the picture, SRC, Alt, Height, Width. 1. SRC is the image link address, which is generally recommended to fill in the absolute address, which can shorten the load time of the web page; 2. ALT tag, as the search engine can not identify the content, you need an Alt tag to convey information on the picture, this for search engines Or users are very friendly; 3. Height tags are the height of the picture; 4Width is the width of the picture, defining the height and width of the picture, will help the search engine reduce loading time.

4. NOFOLLOW label

I sometimes export links are sometimes exported, such as Baidu cloud chassis, plus the NOFOLLOW label, can avoid the loss of weights, you need special reminders that: friendship link should not add the Nofollow link, what is friendship, friendship It is trusting and impact each other!

5. DIV tag

DIV is often used to nested, and a large number of DIVs in the page DIV will be slowed down, and there are too many DIVs that nested too many DIVs. The browser is incompatible. In addition, add resistance to the search engine spider, which is very unfriendled for search engines.

6. Table tag

The Table tag is a table label. The rise in Table places is used by a person who is placed in a newspaper. Therefore, many webmasters are used to give web page typography, in fact, this method is not available. The best way is to use Div + CSS. This layout method can greatly streamline the code amount of the web page, reduce the volume of the page, which is conducive to the reading of the web page, of course, pay special attention to the Nested level of DIV.

7. CSS optimization

1. For some of the same styles, you can write as much as possible, this can effectively compress the code, improve the loading speed of the website; 2. There are more code in Head, and use external calls as much as possible. Reduce the volume of the page, and the CSS file can be cached, reuse, reduce server pressure, etc .; 3. Remove directly for some unused style code.

8. JS code

As we all know, there are too many JS, which will seriously lead to the speed of the webpage, which is not conducive to website optimization. Many small friends will pursue a variety of dazzling special effects, constantly increasing JS code, which greatly increases the difficulty of webpage loading, this kind of work will only be lost!

Is the website code optimization did not imagine? Especially the first 6 points, everyone feels difficult to last 2 points, don’t worry, you can ask the company’s technical personnel; or learn some of the basic knowledge of CSS and JS in private, the improvement of the SEO optimization skill is also very helpful! The 8 points mentioned in this article are also almost the same.

Keywords: website code, code optimization