- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML Doctypes
Whenever you create an HTML document, the doctype is the first thing placed in the document.
It conveys the web browser about the version of the HTML, this page is written on. It is not casesensitive.
Let us see an example displaying DOCTYPE on the top −
Example
<!DOCTYPE html> <html> <head> <title>Document Title comes here</title> </head> <body> <h1> Demo Heading </h1> This is the demo text. </body> </html>
Output
Now let us see some of the declarations for doctype −
HTML5 Declaration
Example
<!DOCTYPE html>
HTML 4 Strict
This document type includes all HTML elements except those that have been deprecated, and those that appear in frameset documents.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
HTML 4 Transitional
This document type includes all HTML elements including those that have been deprecated −
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">;
Advertisements
To Continue Learning Please Login
Login with Google