CSS Flashcards

(42 cards)

1
Q

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

A

Ruleset: selector, code block, property: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

. class name

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 tag name?

A

tag name

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 name

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

What CSS properties make up the box model?

A

Padding, Borders, Margins

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

Which CSS property pushes boxes away from each other?

A

Margins

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

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

A

Padding

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

What is a pseudo-class?

A

A keyword that let’s you apply a style to an element

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

What are CSS pseudo-classes useful for?

A

To style an element in relation to the content and also in relation to external factors

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, em/rem

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

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

A

Row

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

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

A

Put everyone on one row

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

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

A

Because they are block elements

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

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

A

Row

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

What are the three primary components of a page layout (which helper classes do you need?)

A

Container, row, column

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

What is the minimum number of “columns” that you should put in a “row”?

A

One

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

What is the purpose of a “container”?

A

To contain the whole layout and give a minimum weight

18
Q

What is the “default” value of the |position| property of HTML elements?

19
Q

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

A

Flow stays the same

20
Q

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

A

It moves the element around it’s start position

21
Q

How does setting |position: absolute| affect document flow?

A

It’s taken out of the document flow

22
Q

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

A

It’s confined to it’s first non-static ancestor

23
Q

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

A

By making the block |position: relative|

24
Q

What are the four components of “the Cascaade”?

A

Source order, inheritance, specificity, importence

25
What does the term "source order" mean with respect to CSS?
Order of code written
26
How is it possible for the styles of an element to be applied to it's children as well without an additional CSS rule?
Inheritance
27
List the three selector types in order of increasing specificity.
Type, class, ID
28
Why is using |!important| considered bad practice?
It could prevent other developers with writing plug-ins or frameworks
29
What is a "model"?
A copy of the web page made in memory
30
Which "document" is being referred to in the phrase "Document Object Model"?
A webpage
31
Which "object" is being referred to in the phrase "Document Object Model"?
The DOM tree
32
What is a DOM Tree?
A model made of many objects.
33
Give 2 examples of a |document| method that retrieve a single element from the DOM.
getElementById() / querySelector()
34
Give 1 example of a |document| method that retrieve multiple elements from the DOM at once.
querySelectorAll()
35
Why might you want to assign the return value of a DOM query to a variable?
If you need to work with the element more than once
36
What |console| method allows you to inspect the properties of a DOM element object?
console.dir()
37
Why would a |