1. Declare it and place it at the top.
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2. namespace required
<HTML xmlns = "http://www.w3.org/1999/xhtml" lang = "gb2312">
3. Define language Encoding
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<? XML version = "1.0" encoding = "gb2312"?>
4. Call the style sheet
Embedded:
<Style type = "text/CSS"> <! -- Body {Background: # FFF; color: #000 ;}--> </style>
External formula:
<LINK rel = "stylesheet" REV = "stylesheet" href = "CSS/style.css" type = "text/CSS" Media = "all"/>
Double table method:
<LINK rel = "stylesheet" REV = "stylesheet" href = "CSS/style.css" type = "text/CSS" Media = "all"/>
<Style type = "text/CSS" Media = "all"> @ import URL (CSS/style01.css); </style>
5. small icons in the favorites folder (note that the icons should be placed in the directory !)
<LINK rel = "icon" href = "/favicon. ICO" type = "image/X-icon"/>
<LINK rel = "shortcut icon" href = "/favicon. ICO" type = "image/X-icon"/>
6. Content prepared for search engines
Allows you to search all links in a robot search site. If you want some pages not to be searched, the robots.txt method is recommended.
<Meta content = "all" name = "Robots"/>
Set site author information
<Meta name = "author" content = "[email] yecaomail@163.com [/Email], weeds"/>
Set site copyright information
<Meta name = "Copyright" content = "www.yecaoweb.com, XHTML, asp"/>
Brief Introduction to the site (recommended)
<Meta name = "Description" content = "Design website"/>
Site keywords (recommended)
<Meta content = "Web, standards, XHTML, CSS, design" name = "keywords"/>
7. XHTML code specification
* Nesting at a layer must be strictly symmetric.
* All must be in lower case.
* The attribute value must contain quotation marks.
* Labels must be strictly disabled.
8. Getting started with CSS
* Group selector, such as: P, TD, Li {font-size: 12px ;}
* Derivative selector, such as: Li a {color: #000 ;}
* ID selector, for example, # PIC {color: #000} // used for calling, as shown in <p id = "pic"> </P>
* Category selector, such as. PIC {color: #000} // used for calling, such as <P class = "pic"> </P>
* In hyperjoin settings, CSS uses four pseudo classes to define the link styles: A: Link, A: visited, A: hover, And A: active. For example:
A: link {font-weight: bold; text-Decoration: none; color: # c00 ;}
A: visited {font-weight: bold; text-Decoration: none; color: # C30 ;}
A: hover {font-weight: bold; text-Decoration: underline; color: # f60 ;}
A: active {font-weight: bold; text-Decoration: none; color: # f90 ;}
9. Getting started with CSS layout. Common CSS attributes are as follows:
Position: absolute; // absolute location
Float: Left or right; // floating
Clear: Both or left or right // unfloat (just like washing dishes after meals !)
Padding: 0px; // inner patch
Margin: 0px; // external patch
Display: block or Inline; // external or Inline
Background: url(img.gif) #000 repeat-x left; // The color value of the URL (image) is aligned repeatedly.
Border: #000 2px solid; // border color Border Width border Style
10. Verification and Common Errors
Go to a foreigner's website for verification. [url] http://validator.w3.org/#/url] (why not a Chinese website! -_-$) # Html/XHTML/XML Column