Front-end development and SEO, development SEO
As a front-end engineer, it is better to know SEO knowledge for websites to rank top in search engines. When writing webpage code, pay attention to the following points:
1. Set rel = "nofollow" for the tag in the Link, prompting the spider not to crawl. Set the title in all <a> so that the spider can better understand it.
2. <br/> it is only applicable to text line breaks. Other line breaks can be used <p> <br/> </p>
3. The label must contain the alt attribute. When the image fails to be displayed, a text prompt is displayed, which also allows the spider to recognize the image.
4. Use iframe as few as possible
5. Do not use JS output for important content
6. For elements that do not need to be displayed temporarily, use the z-index attribute instead of the display: none; Code, because Spider will filter the content whose display attribute is none.
7. The website structure is flat-like, and the directory structure should not be too deep. Each page can be clicked three times away from the home page, which is not conducive to search engine crawling.
8. Each page must have only one H1 tag, H2 ~ The H6 tag can be used multiple times to increase the weight of the H1 tag.
To be updated later ......