0
0
HTMLmarkup~5 mins

DOCTYPE declaration in HTML - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the <!DOCTYPE> declaration in an HTML document?
The <!DOCTYPE> declaration tells the web browser which version of HTML the page is written in, so it can display the page correctly.
Click to reveal answer
beginner
Where should the <!DOCTYPE> declaration be placed in an HTML file?
It must be the very first line at the top of the HTML file, before the <html> tag.
Click to reveal answer
beginner
What is the correct DOCTYPE declaration for HTML5?
The correct DOCTYPE for HTML5 is <!DOCTYPE html>.
Click to reveal answer
beginner
True or False: The DOCTYPE declaration is case sensitive.
False. The DOCTYPE declaration is not case sensitive, but it is best practice to write it in uppercase or lowercase consistently.
Click to reveal answer
intermediate
What happens if you omit the DOCTYPE declaration in an HTML document?
Without a DOCTYPE, browsers may enter "quirks mode," which can cause inconsistent and incorrect page rendering.
Click to reveal answer
What does the <!DOCTYPE html> declaration specify?
AThe HTML version used by the document
BThe page title
CThe character encoding
DThe CSS stylesheet link
Where should the DOCTYPE declaration be placed in an HTML file?
AInside the <code>&lt;body&gt;</code> tag
BInside the <code>&lt;head&gt;</code> tag
CAt the bottom of the file
DAt the very top before <code>&lt;html&gt;</code>
What is the correct DOCTYPE declaration for HTML5?
A<code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;</code>
B<code>&lt;!DOCTYPE HTML SYSTEM&gt;</code>
C<code>&lt;!DOCTYPE html&gt;</code>
D<code>&lt;!DOCTYPE html5&gt;</code>
What might happen if the DOCTYPE declaration is missing?
AThe page will not load at all
BThe browser will enter quirks mode causing inconsistent rendering
CThe page will load faster
DThe browser will automatically add the DOCTYPE
Is the DOCTYPE declaration case sensitive?
ANo, it is not case sensitive
BYes, it must be lowercase
CYes, it must be uppercase
DOnly the word DOCTYPE is case sensitive
Explain what the DOCTYPE declaration does and why it is important in an HTML document.
Think about how browsers know how to read your page.
You got /4 concepts.
    Describe the correct syntax for the HTML5 DOCTYPE declaration and where it should be placed in your HTML file.
    It's a short line at the very start.
    You got /3 concepts.