Jeff Cooper
Jeff Cooper

Reputation: 11

Why do you need a "!" in the tag <!DOCTYPE html> and what does it do?

It seems most tags don't have the !, but this one does. I understand that concept of the DOCTYPE, just curious why it needs to have a "!".

Upvotes: 1

Views: 60

Answers (2)

Hu Bin
Hu Bin

Reputation: 459

I think it is the definition, without any reason! Just like you alias "Jeff Cooper" as your nick name.

Upvotes: 0

misterManSam
misterManSam

Reputation: 24692

HTML is based on Standard Generalized Markup Language (SGML), which is the standard used to define a document.

SGML uses the <! delimiter to specify meta-information, including Document Type Declarations (DTD). This is why it is used when marking up HTML documents.

3.1 Introduction to SGML

SGML is a system for defining markup languages. Authors mark up their documents by representing structural, presentational, and semantic information alongside content. HTML is one example of a markup language.

Upvotes: 1

Related Questions