CSS Flashcards

1
Q

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

A

selector, declaration block

property and values

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

In Css, you select the class attribute with the .class selector

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

In css you select elements by their type by just typing 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

In css, you select the id attribute with the #id selector

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

RGB(x,x,x); hex code #234513; and color names that are predefined

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

There are always three properties to a css box model. Border, margin, and 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

The property that pushes boxes away from each other is 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

The property that adds space between the box content and its border is padding.

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

What is a pseudo-class?

A

class applied by the browser when an element is in a specific state.

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

Changing what an element is doing based on what the user is doing. They also simplify processes that would otherwise take more time to do

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

The types of units that can adjust the font-size in css are pixels (px), percentages (%), and EMS (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

The css property that controls the font used for inside the text element is 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

The default flex-direction of a flex container is 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

The default of a flex-wrap is nowrap in a flex container.

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

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

A

position: static; is the default property for html elements

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

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

A

It stays in the same spot of document flow but can be moved relative to where it was originally

17
Q

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

A

It just doesn’t go anywhere, it’s exactly the same but simply becomes a position element

18
Q

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

A

absolute is removed from the normal document flow. Elements no longer consider it to exist

19
Q

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

A

It is positioned relative to its closest positioned ancestor. It’s placed in the initial containing block. It’s place within the nearest non-static ancestor.

20
Q

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

A

By nesting it in a non static position position (relative usually)

21
Q

What are the four box offset properties?

A

Top Bottom Left and RIght

22
Q

What are the four components of “the Cascade”.

A

The first one is source order, second is inheritance, specificity, and !important

23
Q

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

A

The order of CSS rules that were written in your stylesheet is what determines it. The later rule takes priority over one earlier.

24
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

Children will inherit the values and styling of their parent. So you can just apply it to the parent

25
Q

List the three selector types in order of increasing specificity.

A

type selector > class selector> id selector

26
Q

Why is using !important considered bad practice?

A

It makes debugging difficult and breaks the natural cascading in your stylesheets

27
Q

What does the transform property do?

A

It modifies the coordinate space of the css visual formatting model

28
Q

Give four examples of CSS transform functions.

A

rotate, skew, scale, translate(y)

29
Q

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

A

min-width max width, color print

30
Q

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

A

the meta viewport tag

31
Q

The transition property is shorthand for which four CSS properties?

A

The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, and transition-delay.