Document Structure Flashcards

1
Q

What does <!DOCTYPE html> declare in an HTML document?

A

It declares the document type and tells the browser to use standards mode.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the <html> element represent in an HTML document?

A

The root element of the document.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the two primary sections of an HTML document?

A

The head (contains metadata) and the body (contains visible content).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the lang attribute in the <html> tag specify?

A

What does the lang attribute in the <html> tag specify?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the essential elements to include in every HTML document?

A
  • Document type declaration.
  • Content’s human language (lang attribute).
  • Character set (charset attribute).
  • Title of the application.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the role of the <meta charset="utf-8" /> tag?

A

It specifies the character encoding for the document, with UTF-8 being the standard.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the <title> element define in an HTML document?

A

It defines the unique title of the page, which is displayed in the browser’s tab.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the purpose of the viewport <meta> tag?

A

It helps ensure proper rendering and responsiveness on different devices by adjusting the page layout to fit screen sizes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How should CSS be included in an HTML document?

A

CSS should be included using the <link> tag to reference external stylesheets.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the defer attribute in a <script> tag do?

A

It ensures that the script is executed after the page has finished rendering.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you include a favicon in the <head> section?

A

Use the <link rel="icon" href="path-to-icon" /> tag.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the purpose of HTML comments?

A

HTML comments are used to include notes in the code that are not displayed in the rendered page or parsed by the browser.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly