CSS Flashcards

1
Q

How do you use inline style declaration?

A

style=””

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

What should you end an inline style declaration with?

A

;

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

How do you set the colour of an element?

A

color=””

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

Where do CSS selectors go?

A

the style tag

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

What does a CSS selector look like?

A

tag {
style;
}

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

What does a CSS class declaration look like?

A

.class-name {
styles;
}

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

How do you apply a CSS class to a tag?

A

class=””

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

How do you change the font size property?

A

font-size: (number)px;

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

How do you change the font property

A

font-family: font;

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

How do you add a “backup” font if the first is unavailable

A

font-family: font, backup font;

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

How do you set a tag’s width?

A

width: (number)px;

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

How do you add rounded corners to a border?

A

border-radius: (number)px;

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

How do you make an image circular?

A

border-radius: 50%;

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

How do you give an element a background

A

background-color: color;

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

True or False, id attributes are required to be unique

A

False

Though they are not required to be unique it is considered best practice to make them unique

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

how do you give an element an id?

A

id=”

17
Q

How do you reference a class?

A

With a . prefix

18
Q

How do you reference an id?

A

with a # prefix

19
Q

What is padding?

A

The distance between the text of an element and the border surrounding it

20
Q

What is the margin?

A

The amount of space between the border of an element and the surrounding elements

21
Q

How do you set different amounts of padding on different sides of an element?

A

padding-top
padding-right
padding-bottom
padding-left

22
Q

How do you use an attribute selector

A

[attr=”value”]{
style
}

23
Q

If an element has two style classes, which will be used?

A

Specific beats general, the last declared class will be used

24
Q

How can you prevent a class from being overwritten?

A

!important

25
Q

How do you create a CSS variable

A

–variable-name: style;

26
Q

How do you use a CSS variable?

A

property: var(–variable-name);