CSS Flashcards

1
Q

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

A

Selector, declaration

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

.element[attribute]

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

selector type

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

Hex, name, RGB

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, border, margin

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 state of the element

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

They can apply style to different states of an element. For example, if a link has been visited, it can be changed color to indicate that its been clicked before.

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

Name at least 2 units of type size in CSS

A

em, px, rem

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

They are block elements and block elements start on new lines

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?

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

Relative allows you to move the item in relation to normal flow.

19
Q

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

A

if you want to move it 10 pixels up then set bottom to 10 px;

20
Q

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

A

The box is taken out of normal flow and no longer affects the position of other elements.

21
Q

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

A

The position will appear in relation to its containing elements

22
Q

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

A

fixed positioning

23
Q

What are the four box offset properties?

A

top, right, bottom, left

24
Q

What are the four components of “the Cascade”.

A

source order, inheritance, specificity, and importance/cascade?

25
What does the term "source order" mean with respect to CSS?
If a rule has the same weight then it will go with the last rule.
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
What does the transform property do?
Applies 2D or 3D transformations on an element
28
Name 4 transform properties
rotate, scale, move, skew
29
Give two examples of media features that you can query in a @media rule.
Width, height
30
Which HTML meta tag is used in mobile-responsive web pages
Viewport
31
What is a breakpoint in responsive Web Design?
Point where the design will break
32
What is the advantage of using a percentage width instead of a fixed width for a col class in a responsive layout?
It can adapt to the size of the screen
33
If you introduce CSS rules for a smaller min-width after the styles for a larger min-width, the CSS rules for the small min-width will win. Why is that?
cascading rule