CSS Flashcards

(24 cards)

1
Q

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

A

CSS selector, declaration block, 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

(Dot).class-name

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

By the <p> contents of the appropriate html container / tag = p {
</p>

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

hashtag # appropriate ID name from the index.html doc #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

keywords, hexadecimal , RBG

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

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

is a selector the selects a element that are in a specific state(special 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

writing less code and to simplify

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

px = pixel
rem = relative to root element
% =percentage

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

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

A

Static

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

What are the four box offset properties?

A

Left, right, bottom and top

17
Q

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

18
Q

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

19
Q

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

A

Maintains normal document flow, but it’s final postion can now be adjusted.

20
Q

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

A

it will have no effect on it’s positioning at all, it will be exactly as it would be if you left it as position: static;

21
Q

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

A

elements are removed from the flow of elements on the page. An element with this type of positioning is not affected by other elements and it doesn’t affect other elements.

22
Q

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

A

these values will be relative to the next parent element with relative (or absolute) positioning. If there is no such parent, it will default all the way back up to the element itself meaning it will be placed relative to the page itself. Its overuse or improper use can limit the flexibility of your site.

23
Q

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

A

the containing block is formed by the edge of the padding box of the nearest ancestor element that has a position value other than static

24
Q

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

A

They are block elements