The Box Model Flashcards

1
Q

You can customise the borders of an elements box via the properties of border-width, border-style, and border-color individually, but how do you modify all of these properties on one line?

A

border: 2px solid #FFF;

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

You can not view a box’s border if the border’s style has not been set. With what property can give you freedom to customise a box’s border and make it visible?

A

border-style: 2px;

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

What is the difference between padding and margin?

A

Padding refers to the spacing between an elements content and it’s border, margin refers to the spacing outside of the border/box and in between other elements.

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

How can you change a border so that it is not a square, but a circle?

A

border-radius: 100%;

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

With various properties in the box model such as padding or margin etc where you can modify all four sides, what is a shortcut if left + right are the same and top + bottom too?

A

padding: 5px 10px;

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

The margin property allows you to centre content with the ‘auto’ value as this will automatically centre the selected element, however what else needs to be added for this to function correctly?

A

h1 {
margin: 10 auto;
width: 100%;
}

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

All major web browsers have a default stylesheet they use in the absence of an external stylesheet, these default stylesheets are called user agent stylesheets. Many developers choose to reset these default values so that they can truly work with a clean state. How would you start off fresh, give the example of code.

A
  • {
    margin: 0;
    padding: 0;
    }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the difference between the visibility property when it’s valued to hidden and the display property when it’s valued to none.

A

When the visibility property is valued to hidden the selected content is hidden, but there will still be an empty space where this element is intended to be. Where as, with display none, the selected content is hidden and there will not be an empty space left for this element

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

What value of a certain property is a valuable tool for creating vertical or horizontal layouts?

A

display: flex;

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