Showing posts with label <!DOCTYPE>. Show all posts
Showing posts with label <!DOCTYPE>. Show all posts

DOCTYPE Tag

<!DOCTYPE>    
  • Document Type Definition.
  • This is basic HTML tag
  • Apply to Define the document type.
  • In short words also called DTD tag

Basic HTML Tags for Web Page

HTML Tags
Description
<!DOCTYPE> 
Use for Defining the document type. Also called DTD tag (Document Type Definition)
<html>
Use for Defining the HTML document.
<title>
Use to describe a title for the web page.
<body>
Use to define the document's body data.
<h1>
<h2>
<h3>
<h4>
<h5>
<h6>
HTML heading tags are use to define the headings in different formats on web page.
<p>
Use to start new paragraph
<br>
Use to break the data/text line and start in new line.
<hr>
It defines a horizontal line.
<!--...-->
Use for comments. This is only developer to write some comments to remember. This tag does not appear on web page.

HOW TO DEFINE DOCUMENT TYPE DEFINITION (DTD)

<!DOCTYPE> declare it in very first line of HTML document, after this start <html> tag.
<!DOCTYPE> is not HTML tag.
<!DOCTYPE> does not have an end tag.
<!DOCTYPE> declaration is NOT case sensitive.
<!DOCTYPE> provide the information about HTML version use in web page to the web browser.
HTML 4.01is based on SGML so it declared the <!DOCTYPE>.
HTML5 is not based on SGML therefore it does not need a DTD reference or <!DOCTYPE>.

Tip: Must add <!DOCTYPE> to HTML documents, so that all browser easily guess what type of document is.

What is DOCUMENT TYPE DEFINITION (DTD)

Document type definition also called DTD. DTD documents coded in a particular language called HTML (Hyper Text Markup Language). In HTML code DTD define as <!DOCTYPE>.
The definition of DTD (Document Type Definition) is “a particular document or set of statements that follow the rules and regulations of the SGML (Standard Generalized Markup Language) or XML (Extensible Markup Language).
The function of a DTD (Document Type Definition) is to describe the document structure, list of authorized elements and attributes and authorized structure widget.

Example

<!DOCTYPE html>
<html>
<head>
<title>Web Data</title>
</head>
<body>
Unique content of the document......
</body>
</html>