CSS Flashcards

1
Q

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

A

The selector, the declaration block, property value pairs

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

You use “.” followed by the elements with that class 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

You use the name of the element

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

You us “#” followed by elements with that id attribute

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

Using one of the 147 predefined colors, rgba, and hexadecimal color values

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

Border, margin, padding

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 adds 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

Adds some kind of functionality to a selector

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

What are CSS pseudo-classes used for?

A

They allow you to change the style of elements when you interact with them

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 adjust font-size in CSS

A

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 are the four components of “the cascade”

A

Importance, Specificity, Source Order, Inheritance

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

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

A

The order that the CSS rules be applied

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

Because of inheritance, some styles of an element will be adopted by its child element

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

List the three selector types in order of specificity

A

Id, class, type selector

17
Q

Why is using !important considered bad practice?

A

It breaks the cascade of the CSS and makes debugging harder

18
Q

What is the defaultflex-directionof aflexcontainer?

A

flex-direction: row;

19
Q

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

A

flex-wrap: no-

wrap;

20
Q

What does the transform property do?

A

It lets you rotate, scale, move, and skew elements

21
Q

Give four examples of CSS transform functions.

A

rotate()
Scale()
skew()
translate()

22
Q

Thetransitionproperty is shorthand for which four CSS properties?

A

Transition-property, Transition-duration, transition-timing-function, transition-delay,

23
Q

Give two examples of media features that you can query in an@mediarule.

A

Width, color

24
Q

Which HTML meta tag is used in mobile-responsive web pages?

A

Viewport meta tag

25
Q

What is abreakpointin responsive Web design?

A

A point where there is a change of rules for how the website content is displayed depending on screen size

26
Q

What is the advantage of using a percentage (e.g.50%)widthinstead of a fixed (e.g.px)widthfor a “column” class in a responsive layout?

A

Percentages allow you to set widths for all kinds of screens, without to make rules for every type of screen size

27
Q

If you introduce CSS rules for a smallermin-widthafterthe styles for a largermin-widthin your style sheet, the CSS rules for thesmallermin-widthwill “win”. Why is that?

A

The Css will read from from top to bottom and will go with the one afterwards if the css rulesets have the same specificity