Interview Question

What is the purpose of <!DOCTYPE html>?

The doctype asks the browser to render the page using modern standards.

💡 Concept ✅ Quick Revision 🌐 HTML

Answer

`<!DOCTYPE html>` tells the browser to use modern HTML rules. • It is written at the very top of the file. • It helps browsers display the page in standards mode. • It is a declaration, not a normal HTML tag.

💡 Simple Example

<!DOCTYPE html> <html lang="en"> <head><meta charset="utf-8"><title>Example</title></head> <body><p>Hello</p></body> </html>

⚡ Quick Revision

The doctype asks the browser to render the page using modern standards.