ホームページ >ウェブフロントエンド >htmlチュートリアル >DOCTYPE HTML
次の記事では DOCTYPE HTML の概要を説明します。 HTML では、ドキュメント タイプはユーザー指示を宣言し、HTML や XML コーディング自体のようなマークアップ言語を使用してデータを Web ブラウザーに変換するために使用されます。ドキュメントの最初のステップとしてドキュメント タイプを宣言しました。一般に、DOCTYPE はタグ、要素、属性を考慮しません。マークアップ言語のバージョンを識別するのに役立ちます。 tag は、HTML マークアップ言語のルート タグまたは要素です。また、すべての Web コンテンツを保存して保持するのにも役立ちます。また、
構文:
HTML またはその他のマークアップ言語を使用する場合、文書型宣言の場合と同様に、各タグと要素に一連の構文があります。
以下は、
<!DOCTYPE html> <html> <head> </head> <body> ---Some Front End logic ,codes,tags,elements--- </body> </html>
以下に例を示します:
コード:
<!DOCTYPE html> <html> <head> <title>Sample</title> </head> <body> <p>Welcome To My Domain </p> </body> </html>
出力:
コード:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title> Sample Example for Strict DTD </title> </head> <body> <a href><h1>Please Click </h1></a> <marquee> Welcome To My Domain </marquee> </body> </html>
出力:
コード:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <html> <head> <title> Frameset DTD Example </title> </head> <frameset cols="23%,*,43%"> <frame src="first.html"> <frame src="second.html"> <frame src="third.html"> </frameset> </html>
Output:
In the above set of examples, we will see the sample and basic dtd usages in html. In the first example, we use the that is come under the html5 version. So we use normal and basic html codings. In the second example, we use strict dtd in html 4 version so it will accept the particular tags and elements; it will not be allowed to use the deprecated tag elements in the second example, but in the last example, we use the frameset dtd in the html documents it allows the deprecated elements as well as whatever we use the html 4 transitional dtd elements and also will include the frameset tag elements.
In html will use DOCTYPE as a better choice for creating the web-based applications, and also it will be helpful for the website users browsers that the document is related to the html based documents. If we suppose will not use the html tag elements in the inside of the document that should be with the DOCTYPE declaration, it must be must with the html standards with the help of web browsers, and templates will check the html standards.
以上がDOCTYPE HTMLの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。