阮一峰的IT笔记:首页 -> 分类 -> HTML 查看所有文章:按分类 | 按月份

HTML 文件的DOCTYPE Declaration

一般使用以下三种DOCTYPE Declaration:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


某些HTML编辑器会自动在xhtml文档前添加

<?xml version="1.0" encoding="utf-8"?>

An XML declaration is an optional declaration used by XML files to define things such as the version of XML being used and the type of character encoding. Unfortunately, IE 6 automatically switches to quirks mode if the DOCTYPE declaration is not the first element on a page. Therefore, unless you are serving your pages as XML documents, it is best to avoid using an XML declaration.

« PHP实现文件上传 | 首页 | 安全的管理你的远程Ubuntu服务器 »

About

This page contains a single entry from the blog posted on 2007年08月02日 20:29.

The previous post in this blog was PHP实现文件上传.

The next post in this blog is 安全的管理你的远程Ubuntu服务器.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33

Post a comment