Update en-US.mdx
update the answer of what does a docType Do
This commit is contained in:
parent
040dc3ff32
commit
4dc40686f1
|
|
@ -9,3 +9,18 @@ A DTD defines how documents of a certain type should be structured (i.e. a `butt
|
|||
For webpages, the DOCTYPE declaration is required. It is used to tell user agents what version of the HTML specifications your document respects. Once a user agent has recognized a correct DOCTYPE, it will trigger the **no-quirks mode** matching this DOCTYPE for reading the document. If a user agent doesn't recognize a correct DOCTYPE, it will trigger the **quirks mode**.
|
||||
|
||||
The DOCTYPE declaration for the HTML5 standards is `<!DOCTYPE html>`.
|
||||
|
||||
Why It Matters:
|
||||
Without DOCTYPE:
|
||||
|
||||
Box model calculations differ
|
||||
CSS rendering inconsistencies
|
||||
JavaScript behavior variations
|
||||
Layout problems across browsers
|
||||
|
||||
With Proper DOCTYPE:
|
||||
|
||||
Predictable CSS box model
|
||||
Consistent rendering
|
||||
Modern HTML5 features work properly
|
||||
Better cross-browser compatibility
|
||||
|
|
|
|||
Loading…
Reference in New Issue