什么是DOCTYPE html PUBLIC?为什么使用XHTML [英] What is DOCTYPE html PUBLIC ? why is XHTML used
问题描述
在aspx页面中什么是DOCTYPE html PUBLIC ....
< !DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
为什么XHTML使用.....在aspx页面?
< html xmlns = http:// www。 w3.org/1999/xhtml\">
< blockquote>这两个是相关的。文档中的第一行定义了DTD:XHTML 1.0 Transitional。 (还有其他人 [ ^ ]。)
< ; !DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional .dtd >
此DTD包含所有HTML元素ts和属性,包括表示元素和不推荐使用的元素(如字体)。不允许使用框架集。标记也必须写成格式良好的XML。它不是那么严格,它支持html和严格的xhtml之间的转换。
html中的
标记告诉解析器,可以根据该命名空间验证标记的内容,当然它也被Visual Studio intellisense使用。 xmlns
属性
浏览器可以在没有任何页面的情况下呈现页面,但可能不会按预期运行。其他元标记也可以添加到浏览器中如何处理页面。
what is DOCTYPE html PUBLIC .... in aspx page?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
why is XHTML used ..... in aspx page ?
<html xmlns="http://www.w3.org/1999/xhtml">
These two are related. The first row in the document defines the DTD: XHTML 1.0 Transitional. (There are others too[^].)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
This DTD contains all HTML elements and attributes, INCLUDING presentational and deprecated elements (like font). Framesets are not allowed. The markup must also be written as well-formed XML. It is not that strict, it is supporting the transition between html and strict xhtml.
Thexmlns
attribute in thehtml
tag tells the parser, that the content of the tag can be validated according to that namespace, and of course it is used also by Visual Studio intellisense.
The browsers can render page without any of them, but might not behave as desired. Other meta markups can be also added to tel the browser how to treat the page.
这篇关于什么是DOCTYPE html PUBLIC?为什么使用XHTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!