CSS Flashcards

(39 cards)

1
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
2
Q

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

A

In CSS the last style rule set for a selector takes effect

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

List the three selector types in order of increasing specificity.

A

class column, type column, no value ( ),

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

Why is using !important considered bad practice?

A

it overrides everything

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

The transition property is shorthand for which four CSS properties?

A

transition - property, duration, timing-function, delay

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

What does the transform property do?

A

lets you rotate, scale, skew, or translate an element.

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

Give four examples of CSS transform functions.

A

Rotate, translate, scale, and skew

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

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

A

selector, declaration, property, value

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

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

A

.then name of class attribute

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

In CSS, how do you select elements by their tag name?

A

just the name of the element

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

In CSS, how do you select an element by it’s id attribute?

A
  • # then name of id attribute
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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

A

rgb, hex, hsl

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

What CSS properties make up the box model?

A

border, margin, padding, height and width

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

What 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
16
Q

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

17
Q

What is a pseudo-class?

A

a keyword added to a selector that specifies a special state of the selected element(s)

18
Q

What are CSS pseudo-classes useful for?

A

Easier to target css selectors that involve user interaction

19
Q

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

20
Q

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

21
Q

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

22
Q

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

23
Q

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

A

they are block elements

24
Q

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

25
What are the 3 primary components of a page layout? (Which helper classes do you need)?
containers, columns, and rows
26
What is the minimum number of columns that you should put in a row?
at least one
27
What is the purpose of a container?
to group your rows and columns easier (basically similar to an outline)
28
What is the default value for the position property of HTML elements?
static
29
How does the setting position: relative on an element affect document flow?
It moves the element in relation to where it would have been in normal flow
30
How does setting position: relative on an element affect where it appears on the page?
using offset properties you can indicate how far to move the element from where it would have been in normal flow
31
How does setting position: absolute on an element affect document flow?
it is taken out of normal flow and no longer affects the position of other elements on the page (it's like the element no longer exists)
32
How does setting position: absolute on an element affect where it appears on the page?
the element can be positioned anywhere on the page relative to within the boundary of the next ancestor non static block
33
How do you constrain an absolutely positioned element to a containing block?
by using the ancestor container that is not static
34
Where are the four box offset properties?
top, bottom, left, and right
35
Give two examples of media features that you can query in an @media rule.
Width, hover
36
Which HTML meta tag is used in mobile-responsive web pages?
with the name="viewport"
37
What is a breakpoint in responsive Web design?
different rule set for different parameters
38
What is the advantage of using a percentage (e.g. 50%) width instead of a fixed (e.g. px) width for a "column" class in a responsive layout?
it would scale with whatever the view page size is rather than having a set value and not adjust to the view page
39
If you introduce CSS rules for a smaller min-width after the styles for a larger min-width in your style sheet, the CSS rules for the smaller min-width will "win". Why is that?
because of the CSS cascade where the most recent rule set has priority