CSS Flashcards

1
Q

Name three different types of values you can use to specify colors in CSS

A

Hex , color name, rgb

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

Why is using !important considered bad practice?

A

it makes debugging more difficult

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

List the three selector types in order of increasing specificity.

A

type, class, ID

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

How is it possible for the styles of an element to be applied to its children as well
without an additional CSS rule?

A

Inheritance

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

What does the term “source order” mean with respect to CSS?

A

the order that your CSS rules are written in your stylesheet.
Top=weaker
Bottom=Stronger

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

What are the four components of “the Cascade”.

A

Inheritance, Specificity, !important, Source Order

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

What CSS properties make up the box model?

A
Height 
Width
Border 
Margin
Padding
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which CSS property pushes boxes away from each other?

A

MARGIN

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

Which CSS property add space between a box’s content and its border?

A

Padding is the space between the border of a box and any content contained within it.

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

Name two types of units that can be used to adjust font-size in CSS.

A

Pixels & Percentages

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

What CSS property controls the font used for the text inside an element?

A

The font-family property allows you to specify the typeface that should be used for any text inside the element(s) to which a CSS rule applies.

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

What is a pseudo-class?

A

A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s).

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

What are CSS pseudo-classes useful for?

A

All pseudo-classes behave in this same kind of way. They target some bit of your document that is in a certain state, behaving as if you had added a class into your HTML. Take a look at some other examples on MDN:

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

What is the default value for the position property of HTML elements?

A

Static Position

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

How does setting position: relative on an element affect document flow?

A

normal flow

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

How does setting position: relative on an element affect where it appears on the page?

A

Relative positioning moves an element in relation to where it would have been in normal flow.

17
Q

How does setting position: absolute on an element affect document flow?

A

When the position property is given a value of absolute,the box is taken out of normal
flow and no longer affects the position of other elements on the page. (They act like it is not there.)

18
Q

How does setting position: absolute on an element affect where it appears on the page?

A

The box offset properties (top or bottom and left or right) specify where the element
should appear in relation to its containing element.

19
Q

How do you constrain an absolutely positioned element to a containing block?

A

Set element in non static element