Activating Browser Modes with Doctype
分类:未分类
Activating Browser Modes with Doctype
1.Standards mode
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2.XML declaration makes IE 6 (but not IE 7!) trigger the Quirks mode.
可以通过临时向页中添加以下客户端脚本(该脚本在最新版本的 Internet Explorer、Firefox 和 Opera 中有效)确定浏览器的当前呈现模式。
<script type="text/javascript"> alert( document.compatMode ); </script>