Prelims - CSS padding Flashcards

1
Q

is used to create space around an element’s content, inside of any defined borders

A

CSS Padding

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

CSS has properties for specifying the padding for each side of an element

A

padding-top
padding-right
padding-bottom
padding-left

div {
  padding-top: 50px;
  padding-right: 30px;
  padding-bottom: 50px;
  padding-left: 80px;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

All the padding properties can have the following values

A

length - specifies a padding in px, pt, cm, etc.
% - specifies a padding in % of the width of the containing element
inherit - specifies that the padding should be inherited from the parent element

Negative values are not allowed

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

If the padding property has four values the shorthand would be

A

padding: 25px 50px 75px 100px;

top padding is 25px
right padding is 50px
bottom padding is 75px
left padding is 100px

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

This causes the element to maintain its actual width; if you increase the padding, the available content space will decrease

A

box-sizing

div {
  width: 300px;
  padding: 25px;
  box-sizing: border-box;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly