CSS Flashcards

1
Q

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

A

Selector, Declaration Block, Properties, Values (all together they are called a “rule set”)

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 theirclassattribute?

A

.classname

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

the element 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 itsidattribute?

A

#

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

RBG values, Hex codes, 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

Padding, Margin, Border, Width and Height

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 CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s). For example, :hover can be used to change a button’s color when the user’s pointer hovers over it.

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

Pseudo-classes let you apply a style to an element not only in relation to the content of the document tree, but also in relation to external factors:

like the history of the navigator (:visited, for example), the status of its content (like :checked on certain form elements), or the position of the mouse (like :hover, which lets you know if the mouse is over an element or not).

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

Name two types of units that can be used to adjustfont-sizein CSS.

A

px, em, %

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 defaultflex-directionof aflexcontainer?

A

Row

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

What is the defaultflex-wrapof aflexcontainer?

A

no-wrap

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

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

A

They are Block elements

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

What is the defaultflex-directionof an element withdisplay: flex?

17
Q

What is thedefaultvalue for thepositionproperty of HTML elements?

18
Q

How does settingposition: relativeon an element affect document flow?

A

It doesn’t not affect the elements around it

19
Q

how does settingposition: relativeon an element affect where it appears on the page?

20
Q

How does settingposition: absoluteon an element affect document flow?

A

removed entirely. other elements act like its not there

21
Q

How does settingposition: absoluteon an element affect where it appears on the page?

A

it is removed from the document flow and appears in relation to its containing element

22
Q

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

A

setting an ancestor element to something other than static

23
Q

What are the four box offset properties?

A

top bottom left and right

24
Q

What are the four components of “the Cascade”.

A

Source Order, Inheritance, Specificity & !important

25
What does the term "source order" mean with respect to CSS?
Assuming the same specificity, the last rule to be written take precedence.
26
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
inherit
27
List the three selector types in order of increasing specificity.
element class id
28
Why is using !important considered bad practice?
it makes debugging more difficult by breaking the natural cascading in your stylesheets (overriding all other styling)
29
What does the transform property do?
The transform CSS property lets you rotate, scale, skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model.
30
Give four examples of CSS transform functions.
translate, rotate, scale, skew
31
The transition property is shorthand for which four CSS properties?
transition-property, transition-duration, transition-timing-function, and transition-delay.
32
Give two examples of media features that you can query in an @media rule
min-width and max-width
33
What is a breakpoint in responsive Web design?
spot where your styling will change typically in regards to the viewport width
34
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 will always scale to the desired width no matter what the screen size is, also has to do with pixel density.
35
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?
Source Order