CSS Flashcards

1
Q

What are the names of the individual pieces of a CSS rule?

A

selector, declaration (declaration block), property, and value

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

In CSS, how do you select elements by their class attribute?

A

period then name of file

ex: .class

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

In CSS, how do you select elements by their type?

A

Type selector. You just type the element name that matches html tag element.
Ex: h1 –which would match to h1–

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

In CSS, how do you select an element by its id attribute?

A
#. ID selector. 
Ex: #indroduction --this targets the id attribute has a value of
introduction--
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A

RGB values (ex: rgb(100,100,90)), Hex codes (ex: #ee3e80), Color Names

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

What CSS properties make up the box model?

A

Margin, Border, Padding, Content

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
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
8
Q

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

A

Padding

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

What is a pseudo-class?

A

A keyword added to a selector that specifies a special state of the selected element.
Ex: selector:hover {
color:blue;
}

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

What are CSS pseudo-classes useful for?

A

Activates a function when a condition in the selector is met.

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

Name at least two units of type size in CSS.

A

px, ems, and %.

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

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

A

font-family

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

What is the default flex-direction of a flex container?

A

Row (going from left to right)

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

What is the default flex-wrap of a flex container?

A

nowrap. It is used to specify that the item has no wrap. It makes item wrap in single lines.

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

What are the four components of “the Cascade”.

A
Four steps in the cascade algorithm, in order:
Relevance.
Origin and importance.
Specificity.
Order of appearance.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

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

A

The order that your CSS rules are written in your stylesheet

17
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 is the process by which certain CSS properties on a child HTML element can receive value from a parent element, if no CSS for that property is directly declared on the child element.

18
Q

List the three selector types in order of increasing specificity.

A
  • or type (generally hits everything), class, ID, !important (although try to avoid doing this).
19
Q

Why is using !important considered bad practice?

A

It disrupts the natural flow in applying the css rules where in properties are applied from top to bottom; makes debugging more difficult.

20
Q

Why do two div elements “vertically stack” on one another by default?

A

Because they are block elements

21
Q

What is the default flex-direction of an element with display: flex?

A

horizontal