CSS Flashcards

1
Q

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

A

Selector and declarations property and value.

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

With a . period and name of 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 tag name?

A

Just 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

pound and name of 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

RGB values (rgb(100,100,90), hex codes(#ee3e80), color names(darkcyan)

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 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 special state of the selected elements.

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

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 position of the mouse.

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

nowrap

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

Because they’re 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

row

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

What are the three primary components of a page layout? (Which helper classes do you need?)

A

Container, rows, columns

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

What is the minimum number of columns that you should put in a row?

A

1

19
Q

What is the purpose of a container?

A

To hold all of its contents or contain the entire layout.

20
Q

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

A

static

21
Q

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

A

It has no effect on doc flow. Sibling elements still think it’s in its original spot. Shifts from its original position.

22
Q

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

A

It will move relative to where it would be if it was static. 10px top would move 10px away from the top.

23
Q

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

A

No longer a part of the document flow. Removed from document flow entirely.

24
Q

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

A

They cant get moved to where they normally existed. Finds a environment to exist in, nearest element that is normal positioned which is the direct ancestor.

25
Q

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

A

Setting an anchor point it can exist inside of. So an element that has a static positioning.

26
Q

What are the four box offset properties?

A

Top bottom left right or inset

27
Q

What are the different types of positioning?

A

A positioned element is an element whose computed position value is either relative, absolute, fixed, or sticky. (In other words, it’s anything except static.)

28
Q

What is the reason for absolute positioning.

A

Putting an element on top of an element

29
Q

What are the four components of “the Cascade”?

A

Source order, inheritance, specificity (strength of selected dependent on how many things its selecting) & !important

30
Q

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

A

The order in which css rule sets are declared. The later rule sets will take priority or previous if they are effecting the same element.

31
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

Inheritance.

32
Q

List the three selector types in order of increasing specificity.

A

no value (don’t refer to any one thing), TYPE Column, Class column, id column

33
Q

Why is using !important considered bad practice?

A

It overrides all other declarations and makes the CSS more difficult to maintain and debug.

34
Q

The transition property is shorthand for which four CSS properties?

A

Transition-property | transition-duration | transition-timing-function (easing function) lets you establish an acceleration curve so that the speed of the transition can vary over its duration. | transition-delay

35
Q

What does the transform property do?

A

Lets you rotate, scale, skew or translate an element. It modifies the coordinate space for the css visual formatting model.

36
Q

Give four examples of CSS transform functions.

A

Matrix, rotate, translate, scale, skew.

37
Q

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

A

Width and orientation

38
Q

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

A

Viewport meta tag

39
Q

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

A

Viewport meta tag

40
Q

What is a breakpoint in responsive Web design?

A

Breakpoint is where the media query rule works on. Boundary line where it shifts. It is where we choose to restructure the layout.

41
Q

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?

A

Percentage takes the screen width into consideration; pixels are static and stays the same regardless of adjusting the screen size.

42
Q

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?

A

Because of CSS cascade; source order. Priority is given to CSS rules that are lower on the page.

43
Q

What is the affect of setting an element to display: none?

A

The element won’t be displayed because it won’t get rendered. The document will treat it as if it didn’t exist along with child elements. No part of document flow.