怪异模式
触发不同渲染模式 > 文档类型的比较

Henri Sivonen编译了一个不同文档类型以及在最常见的浏览器中它们被如何对待的清单，展示了这些情况下，页面是否被渲染为怪异（Q），标准（S）或接近标准（A）模式。接近标准模式的判定标准是非标准的表单元格高度的渲染。这个表格应用于Content-Type为text/html的内容。Content-Type为application/xhtml+xml的内容在Chrome, Firefox, Internet Explorer 9（以及10）, Safari和Opera被渲染为标准模式。Internet Explorer 6, 7和8不支持application/xhtml+xml的Content-Type。
| Doctype | Doctype | NS6 | Mozilla 0> 9.5-1.0 | IE 8+ Firefox Chrome Safari Opera 7> 5+ Netscape 7+ Mozilla 1.0.1+ Konq 3.5+ HTML5 spec | IE 7 Opera 7> 10 | IE 6 Opera 7> 0 | Mac IE 5 | Konq 3> 2 |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 无 | 无 | Q | Q | Q | Q | Q | Q | Q |  |  |
HTML 3.2
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> | Q | Q | Q | Q | Q | Q | Q |  |  |
HTML 4.01
| Strict | 有系统标识符 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | S | S | S | A | A | A | A |  |  |
| Strict | 无系统标识符 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> | S | S | S | A | A | Q | A |  |  |
| Transitional | 有系统标识符 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | S | S | A | A | A | A | Q |  |  |
| Transitional | 无系统标识符 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | Q | Q | Q | Q | Q | Q | Q |  |  |
HTML5
| <!DOCTYPE html> | <!DOCTYPE html> | Q | S | S | A | A | A | ? |  |  |
XHTML Basic
| 有系统标识符且无XML声明 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"> | 有系统标识符且无XML声明 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"> | S | S | S | A | A | A | A |  |  |
XHTML 1.0
| Strict | 有系统标识符和XML声明 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | S | S | S | A | Q | A | Q |  |  |
| Strict | 有系统标识符且无XML声明 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | S | S | S | A | A | A | A |  |  |
| Strict | 无系统标识符，也无XML声明 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"> | S | S | S | A | A | A | ? |  |  |
| Transitional | 有系统标识符且有XML声明 <?xml version="1.0" encoding="UTF-8"?>  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | S | S | A | A | Q | A | Q |  |  |
| Transitional | 有系统标识符，无XML声明 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | S | S | A | A | A | A | Q |  |  |
| Transitional | 无系统标识符，无XML声明 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> | S | S | A | A | A | A | ? |  |  |
XHTML 1.1
| 有系统标识符和XML声明 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | 有系统标识符和XML声明 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | S | S | S | A | Q | A | Q |  |  |
| 有系统标识符，无XML声明 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | 有系统标识符，无XML声明 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | S | S | S | A | A | A | A |  |  |
| Doctype | Doctype | NS6 | Mozilla 0.9.5-1.0 | IE 8+ Firefox Chrome Safari Opera 7.5+ Netscape 7+ Mozilla 1.0.1+ Konq 3.5+ HTML5 spec | IE 7 Opera 7.10 | IE 6 Opera 7.0 | Mac IE 5 | Konq 3.2 |  |  |