M2- Document flow- block vs. inline Flashcards

1
Q

How does a web browser determine where to place elements on the screen?

A

The web browser uses a process called document flow to calculate the position of HTML elements on the screen.

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

What are the two main categories of HTML elements in terms of their layout?

A

HTML elements are organized into two categories: block-level elements and inline elements.

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

What is a block-level element?

A

A block-level element occupies the full horizontal width of its parent container and the vertical height of its content. It starts on a new line, and multiple block-level elements stack on top of each other.

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

Can you give examples of block-level elements?

A

Examples include < div>, < form>, and heading tags like < h1>, < h2>, etc.

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

What is an inline element?

A

An inline element only takes up as much width and height as its content needs. It does not start on a new line, meaning multiple inline elements can appear in a row.

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

Can you give examples of inline elements?

A

Examples include < a>, < img>, < input>, < label>, < b>, < i>, and < span>.

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

How does document flow affect the display of block and inline elements in a web browser?

A

Block-level elements will stack vertically like boxes, each on a new line, while inline elements will align horizontally within the same line of content.

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

Can the behavior of elements (block or inline) be changed? If so, how?

A

Yes, the behavior can be changed using the display CSS property. You can set an element to display as block or inline.

display: inline

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