Layout Flashcards

1
Q

What does the display property do in CSS?

A

Determines how an element and its children behave in the layout.

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

How do inline elements behave?

A

They sit next to each other in the inline direction, like words in a sentence, and their margin and padding are ignored by surrounding elements.

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

How do block elements behave?

A

They create a new line, do not sit alongside each other, expand to the size of the inline dimension, and their margins are respected.

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

What happens when you set display: flex; on an element?

A

The element becomes a flex container, and its children become flex items.

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

What type of layout is Flexbox designed for?

A

One-dimensional layouts (either row or column).

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

How do Flexbox children align by default?

A

They align next to each other in a row and stretch in the block direction to be the same height.

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

What happens when Flexbox items run out of space?

A

By default, they do not wrap, but this behavior can be changed.

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

What type of layout is CSS Grid designed for?

A

Two-dimensional layouts (both row and column control).

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

What is the purpose of the repeat() function in CSS Grid?

A

It allows defining repeating column or row patterns.

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

What is the fr unit in CSS Grid?

A

It represents a fraction of the remaining space.

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

What is the effect of display: inline-block;?

A

It allows inline elements to respect margin and padding while keeping some block-level characteristics.

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

What does float do in CSS?

A

It moves an element to a specified direction (left or right), allowing text and inline elements to wrap around it.

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

What does the position property control?

A

What does the position property control?

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

What is the default position value in CSS?

A

static

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

What does position: relative; do?

A

It makes the element a reference point for absolutely positioned child elements without removing it from the document flow.

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

What does position: absolute; do?

A

It removes the element from the document flow and positions it relative to the nearest positioned ancestor.

17
Q

What does position: fixed; do?

A

It removes the element from the document flow and positions it relative to the viewport, staying fixed during scrolling.

18
Q

What does position: sticky; do?

A

It allows an element to behave like relative positioning until a certain scroll position is reached, after which it stays fixed.

19
Q

hat properties can be used to position absolutely positioned elements?

A

top, right, bottom, left.