2 min readHTML <i need a br >, The DOCTYPE declaration

What Is the DOCTYPE Declaration ⚙

The DOCTYPE declaration (Document Type Declaration) is part of HTML (Hypertext Markup Language) and XML (Extensible Markup Language) documents and is used to define the document type and the version of the markup language the document uses. The DOCTYPE declaration goes at the very beginning of an HTML or XML document and tells the browser or another parser which version of the markup language to use to interpret the document correctly.

In HTML, the DOCTYPE declaration can look like this, for example:

<!DOCTYPE html>

This declaration tells the browser that the document uses HTML5.

In XML, the DOCTYPE declaration can look like this, for example:

<!DOCTYPE xml>

The DOCTYPE declaration helps make sure the document is processed correctly, because different versions of HTML or XML can have different syntax and rules. That makes it an important part of any document that uses these markup languages.

For older versions of HTML, <!DOCTYPE> declarations can look different. For example, for HTML 4.01 Strict:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

#html5magic #codinginhtml #webdesignbasics #htmlcoding #learnhtml #htmltips #frontendhtml #htmlstructure #htmlelements #htmlforbeginners #zimin_dev #zimin_dev_blog

Sasha Zimin

Leave a Reply

Your email address will not be published. Required fields are marked *