为什么我们需要DOCTYPE到HTML / JSP页面? [英] Why do we need DOCTYPE to the HTML/JSP pages?

查看:135
本文介绍了为什么我们需要DOCTYPE到HTML / JSP页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我们需要HTML / JSP页面中的文档类型?页面似乎没有它的工作。

解决方案

Zeldman DOCTYPE(简称为doctype / =noreferrer>写道
$ b

对于文档类型
声明)通知验证器
您正在使用的(X)HTML版本是
,并且必须出现在每个网页
的最顶端。 DOCTYPE是兼容网页的关键
组件:您的
标记和CSS不会在没有
的情况下生效。


blockquote>

并查看24种方法文章过渡与严格标记



在即将到来的HTML 5中,您只需声明

 <!DOCTYPE HTML> 


Why do we need doctype in HTML/JSP pages? Pages seem to work without it.

解决方案

Zeldman wrote

Per HTML and XHTML standards, a DOCTYPE (short for "document type declaration") informs the validator which version of (X)HTML you’re using, and must appear at the very top of every web page. DOCTYPEs are a key component of compliant web pages: your markup and CSS won’t validate without them.

and Take a look at 24 Ways Article "Transitional vs. Strict Markup"

at coming HTML 5 , you'll only need to declare

<!DOCTYPE HTML>

这篇关于为什么我们需要DOCTYPE到HTML / JSP页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆