Research: Standardized HTML code helps search engine rankings

Source: Internet
Author: User
Tags add xmlns root directory
Standard | standardization | ranking | search engine

Standardized HTML code for a website has many advantages, such as: easy to adapt to the revision, code easy maintenance, small code, the site opened fast, suitable for more people to read, and so on, here are not enumerated. From the point of view of website optimization, the standardized HTML code is more used in search engine rankings. But a lot of stationmaster did not realize this point, influence website in search engine rank.

below, we begin to make initial improvements to our website:

Add DOCTYPE to a Web page

What is DOCTYPE? DOCTYPE is the shorthand for document type, understand what is DOCTYPE! DOCTYPE is a document type that describes what version of your HTML or XHTML is, and the browser interprets the page code based on the DTD (document type definition) defined in your DOCTYPE, and you can imagine, What will happen to the wrong doctype.

The XHTML1.0 provides us with three kinds of doctype:

1. Transition type (Transitional)

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

2. Strict type (Strict)

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >

3. Frame type (Frameset)

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 frameset//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd" >

Transition-compatible forms, logos, etc., for beginners, choose the transition type on it!

set a name space

Add the following code after DOCTYPE:

xmlns is a shorthand for XHTML namespace, called "namespaces," and usually our web page has only

Declarative language Encoding

The Simplified Chinese website can be defined as:

<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>

English website can be defined as:

<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>

other settings between <Head></Head>

1. Favorites Small Icon

Make a 16*16 ico icon, name it favicon.ico, place it in the root directory of your site, and then place the following code between <Head></Head>.

<link rel= "icon" href= "/favicon.ico" type= "Image/x-icon"/>
<link rel= "shortcut icon" href= "/favicon.ico" type= "Image/x-icon"/>

2. Author and copyright information

<meta name= "Author" content= "Lightning"/>
<meta name= "Copyright" content= "web teaching Network, All rights reserved"/>

3. Site Introduction

<meta name= "description" content= "Web Teaching network provides the fastest and newest web technology"/>

4. Site Keywords

<meta content= "Web page, Web teaching" name= "keywords"/>

turn off all the labels

Open tags must be closed, such as <p>www.webjx.com</p>, and of course there is a way to close, such as:<br/>

attribute values are enclosed in ""

For example:

assign values to all properties

Incorrect wording: <input ... checked/>
The correct wording is: <input ... checked= "checked"/>

all XHTML elements and their attribute names are in lowercase

XHTML is case sensitive.

The wrong wording is:<title>www.webjx.com</title>
The standard is written as:<title>www.webjx.com</title>

label should be properly nested

Incorrect wording:<div>The correct wording is:<div>

special characters with coded IDs

If "<" is indicated by "<", ">" is indicated by ">".

add alt attribute to picture

The Alt property specifies that the text is displayed for replacement when the picture cannot be displayed.
such as:

output content with a structured element

For example: you want to enter three lines of text, you can use:

Www.webjx.com
Www.webjx.com ">www.webjx.com<br/>www.webjx.com<br/>www.webjx.com

I suggest replacing the above by the following way:

<ul>
<li>www.webjx.com</li>
<li>www.webjx.com</li>
<li>www.webjx.com</li>
</ul>

These specifications can make a primary improvement to your site, improve the search engine's rating on your site.



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.