Document Type Definition (DTD) in HTML
A Document Type Definition (DTD) is a set of rules that defines how an HTML document should be
structured.
It tells the browser which version of HTML the page uses and ensures the webpage is displayed
correctly.
Purpose of DTD:
- Specifies the HTML version.
- Ensures correct rendering in standard mode.
- Defines valid structure and tags.
- Improves browser compatibility.
Types of DTD (Older Versions):
1. Strict DTD – Does not allow deprecated tags.
2. Transitional DTD – Allows old/deprecated tags.
3. Frameset DTD – Used for pages with frames.
HTML5 DTD:
This simple declaration tells the browser to use HTML5 standards.
Short Summary:
DTD is declared at the top of the HTML document using . It helps the browser understand the
document type and display it properly.