HTML: Fundamentals & Structure Flashcards

HTML boilerplate structure Doctype and browser rendering Block vs inline elements Semantic HTML elements (, , , etc.) (20 cards)

1
Q

What is the basic HTML boilerplate structure?

A

The basic HTML boilerplate includes <!DOCTYPE html>, <html>, <head> with meta tags and title, and <body> containing the content.

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

What is the purpose of the <!DOCTYPE html> declaration?

A

It tells the browser to render the page in standards-compliant mode rather than quirks mode.

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

How does the browser handle missing or incorrect DOCTYPE?

A

It may enter quirks mode, causing inconsistent layout and rendering behavior across browsers.

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

What is the difference between block and inline elements in HTML?

A

Block elements take up the full width and start on a new line (e.g., <div>), while inline elements stay in line and only take as much width as needed (e.g., <span>).</span>

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

What are semantic HTML elements?

A

Semantic elements like <header>, <main>, and <footer> clearly describe their purpose, improving accessibility and SEO.

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

Why does semantic HTML matter?

A

It improves readability for developers, aids screen readers, and enhances search engine understanding.

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

Compare <section>, <div>, and <article>.

A

<div> is a generic container, <section> represents a standalone section of content, and <article> represents self-contained content like a blog post.
</article></section></div>

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

What is a use case for using <main>?

A

To wrap the central content of a page, excluding navigation, headers, and footers.

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

What is the advantage of using semantic HTML?

A

Improved accessibility, SEO benefits, and better collaboration among developers and designers.

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

What are the disadvantages of non-semantic HTML?

A

Reduced accessibility, poor SEO, and harder-to-maintain codebases.

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

What is the best practice for nesting semantic tags?

A

Follow logical structure, e.g., place <article> inside <section> and avoid unnecessary nesting for clarity.

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

What are potential gotchas with using <div> everywhere?

A

It creates div soup, reducing semantic meaning and accessibility, and complicating maintenance.

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

What impact does semantic HTML have on system design?

A

It supports better separation of concerns, accessibility, and responsiveness, which are crucial in frontend architecture.

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

How does HTML performance relate to semantic tags?

A

Semantic tags can reduce reliance on JavaScript for structure, improving load time and rendering efficiency.

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

What are common interview questions on HTML fundamentals?

A

‘What is semantic HTML?’, ‘Compare block and inline elements.’, ‘What does <!DOCTYPE html> do?’

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

What are debugging tips for HTML structure issues?

A

Use browser dev tools to inspect element nesting, display types, and rendering mode.

17
Q

What is a real-world tradeoff when choosing between <div> and semantic elements?

A

<div> offers flexibility and quick prototyping, but semantic elements provide long-term clarity and maintainability.
</div>

18
Q

What is the architectural implication of proper HTML structure?

A

Clean, semantic HTML contributes to a well-structured frontend, easier integration with CSS and JavaScript, and future scalability.

19
Q

How do screen readers benefit from semantic HTML?

A

They rely on semantic tags to understand and navigate content properly, improving accessibility for users with disabilities.

20
Q

Why is it important to avoid deeply nested non-semantic containers?

A

It complicates the DOM, reduces readability, and makes styling and debugging harder.