10 steps to XHTML

Source: Internet
Author: User
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
<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

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.