CSS Flashcards

1
Q

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

A

selector, declaration block, within declaration block properties with some 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

by period .

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 by write element name p , h1 etc

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

by typing hash at the beginning #

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

name, rgb, hex

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

padding , border, margin

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

pseudo-class is a keyword added to the selector that specify special state of the selected element

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 appearance of selected html elements while they are in different state

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

no-wrap

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 divs are block lvl 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 position: relative on an element affect document flow?

A

It does not effect document flow.

19
Q

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

A

It doesn’t not effect where it appears on the page.

20
Q

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

A

element is taken out of the flow. All documents are reorganize

21
Q

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

A

it’s will move to left top corner of the page or first relative element

22
Q

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

A

By set relative position for containing block

23
Q

What are the four box offset properties?

A

top , bottom, left right

24
Q

What are the four components of “the Cascade”.

A

relevance, origin and importance, specificity, order of appearance.

25
Q

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

A

The source order means what will have priority when rendering html elements.

26
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

Via CSS “Cascade” the process by which the CSS language determines what styling should ultimately be applied to an element. In this case inheritance.

27
Q

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

A

min-width, max-width

28
Q

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

A

viewport meta tag

29
Q

What is a breakpoint in responsive Web design?

A

Breakpoint in responsive Web design is a point where styling changes.

30
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

easier to scale with a screen

31
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 source order