CSS Flashcards

1
Q

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

A

selector, declaration, property, 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 theirclassattribute?

A

put a dot in front of value of class attribute and curly brackets

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

just the name and curly brackets

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

A

put a # in front of value id attribute and curly brackets

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, Hex Codes, Color names.

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

Class that is applied to an element by the browser under specific circumstances.

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

Adding functionality to certain elements based on user interaction. Applying styling based on user actions.

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, percentages, ems, pt

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

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 defaultflex-directionof aflexcontainer isrow. The flex-direction CSS property sets how flex items are placed in the flex container defining the main axis and the direction (normal or reversed).

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. The flex-wrap CSS property sets whether flex items are forced onto one line or can wrap onto multiple lines.

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

div elements are by default 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.

17
Q

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

A

Static.

18
Q

How does setting positions to relative on an element affect document flow?

A

This moves element from the position it would be in normal flow. Does not affect document flow.

19
Q

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

A

Shifts to the top, right, bottom, or left of where it would have been placed. Setting position to relative will need positioning. By itself does nothing.

20
Q

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

A

This positions the element in relation to its containing element. It is taken out of normal flow, meaning that it does not affect the position of any surrounding elements. Removed from the document flow immediately.

21
Q

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

A

Absolutely positioned elements move as users scroll up and down the page. Out of the document flow.

22
Q

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

A

Using position relative

23
Q

What are the four box offset properties?

A

Top, right, bottom, left

24
Q

What does the transform property do?

A

lets you rotate, scale. Skew, or translate an element. It modifies the coordinate space of the CSS visual formatting model.
Adjusting how the element looks on its coordinate.

25
Q

Give four examples of CSS transform functions.

A

translate. Matrix, scale, rotate, skew.

26
Q

The transition property is shorthand for which four css properties?

A

transition property, transition duration, transition timing function, transition delay.

27
Q

What is abreakpointin responsive Web design?

A

a breakpoint is the point at which a websites content and design will adapt in a certain way.
Point where your styling will shift. Width of the viewport is the most common way.

28
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

adapts to the screen size instead of having to specify px value.

29
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

because of source order.

30
Q

What is flexbox?

A

Flexbox is a collection of CSS properties that allow you to easily control the layout and alignment of elements on a web page.

31
Q

What is position property in CSS?

A

The position CSS property sets how an element is positioned in a document. The top, right, bottom, and left properties determine the final location of positioned elements.