CSS Flashcards

1
Q

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

A

selector
opening curly brace for declaration block
property: value;
ending curly brace of the css rule

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

.class-name {

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

element name

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

id-name {

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 - sits on the outside of the border

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 -Is the space between the border of a box and any content.

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

What is the box model

A

Box model uses border margin padding to decide the size of a single box

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

Size of box is calculated with what (width)

A

width + padding-left + padding-right + border-left + border-right

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

Size of box is calculated with what (height)

A

height + padding-top+ padding- bottom + border-top + border bottom

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

What is a pseudo-class?

A

class applied by the browser in certain situations.

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

Name 3 pseudo-classes

A

hover, active, focus

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

What are CSS pseudo-classes useful for?

A

More interactive webpage

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

Name at least two units of type size in CSS.

A

pixels, percentages, ems

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

What CSS property controls the font used for the text inside an element?

A

Font-family

17
Q

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

A

Row

18
Q

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

A

It’s just a straight line there is no wrap at all.

19
Q

Why do two div elements “vertically stack” on one another by default?

A

because divs are block elements

20
Q

What is the default flex-direction of an element with display: flex?

A

row

21
Q

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

A

static

22
Q

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

A

does not affect the position or surrounding element

23
Q

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

A

Shifts in element in left right top bottom direction and does not affect the position

24
Q

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

A

The element is taken out of normal flow and doesn’t affect the positioning of surrounding elements.. Element gets ignored

25
Q

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

A

Absolutely positioned elements
move as users scroll up and
down the page.

26
Q

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

A

needs to find a non-static parent, or neighbor if not uses the viewport

27
Q

What are the four box offset properties?

A

top, bottom, left, right

28
Q

What does the transform property do?

A

it allows you to modify the coordinate x y z space of the css

29
Q

Give four examples of CSS transform functions?

A

matrix, translate, scale, rotate, skew

30
Q

The transition property is shorthand for which four CSS properties?

A

transition-delay
transition-duration
transition-property
transition-timing-function

31
Q

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

A

color, height, min-width

32
Q

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

A

viewport

33
Q

What is a breakpoint in responsive Web design?

A

The points at which a media query is introduced are known as breakpoints. So it makes the webpage responsive when the screen-size gets bigger or smaller

34
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

flexibility with different viewports

35
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

Source-order