当我在html中删除doctype时会发生什么? [英] what happens when i remove doctype in html?

查看:156
本文介绍了当我在html中删除doctype时会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在html中使用doctype有什么用处,并且使用带有doctype的html页面是否有效?当我在html中删除doctype时,默认格式是什么。请帮助我。



在此先感谢。

没有文档类型:


  1. 浏览器进入怪癖模式并尝试处理您的代码,就好像它是在90年代后期编写的一样。这意味着它们模拟了前辈们存在的许多错误。他们在做这件事的时候并不特别一致(所以你会在Firefox和Internet Explorer中获得明显不同的结果)。

  2. 您将为您的标记添加验证错误

  3. 验证工具将无法确定要验证的规范,除非您通过其他一些方法


what is the use of doctype in html and is it valid to use html page with out doctype?. what is the default format when i remove doctype in html. Please help me on this.

Thanks in advance.

解决方案

Without a Doctype:

  1. Browsers enter Quirks mode and try to deal with your code as if it was written in the late 90s. This means they emulate many bugs that existed in their predecessors. They aren't particularly consistent about how they do this (so you'll get significantly different results in, for example, Firefox and Internet Explorer).
  2. You will add a validation error to your markup
  3. Validation tools won't be able to tell what specification to validate against unless you tell them though some other method

这篇关于当我在html中删除doctype时会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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