CSS Flashcards

1
Q

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

A

element selector
declaration code block
property and value pair

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

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

state 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 its id attribute?

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

color key word
rbg
hexcode

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
padding
border
width
height
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 its border?

A

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 property

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

What is a pseudo-class?

A

a class that allows you to change the appearance of an element when the user is interacting with them

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

applies to very specific html classes

simplifies actions and events in css

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

pixels

rems

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

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

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

block level elements

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

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

A

left to right, row

17
Q

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

18
Q

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

A

not much change. least amount of change

19
Q

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

A

it will move relative to its original position. but at first it will not move

20
Q

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

A

it is removed from the document flow

21
Q

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

A

gets positioned within the nearest non static ancestor element

22
Q

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

A

set the parent element to relative or make it non static

23
Q

What are the four box offset properties?

A

top
left
bottom
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?
the order in which you put your css rules. lower rules will supersede rules in the earlier portion of your document
26
How is it possible for the styles of an element to be applied to its children as well without an additional CSS rule?
inheritance
27
List the three selector types in order of increasing specificity.
type - (e.g., h1) and pseudo-elements (e.g., ::before). class - (e.g., .example), attributes selectors (e.g., [type="radio"]) and pseudo-classes (e.g., :hover). id - (e.g., #example).
28
Why is using !important considered bad practice?
there is nothing able to supersede it except using javascript
29
What does the transform property do?
it lets you change the visual element of the image on the page
30
Give four examples of CSS transform functions.
rotate scale matrix translate
31
The transition property is shorthand for which four CSS properties?
shorthand property for 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
Which HTML meta tag is used in mobile-responsive web pages?
meta name="viewport" content="width=device-width, initial-scale=1"