CSS Flashcards

1
Q

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

A

class , id and type

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

use dot then the 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 using the 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

#

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

hexadecimal, rgba and rgb

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 and content itself

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

selector that selects elements that are in a specific 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

its useful by allowing elements to respond to user interactions

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

Name two types of units that can be used to adjust font-size in CSS.

A

pixel and 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 are the four components of “the Cascade”.

A

Source order. inheritance. Specificity. Importance.

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

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

A

it means in which order the code is being read top to bottom

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
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

inheritance

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

List the three selector types in order of increasing specificity.

A

class, id, and element name

17
Q

Why is using !important considered bad practice?

A

its hard to debug and its hard to overwrite it

18
Q

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

A

static

19
Q

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

A

once the positioned element has taken its place in the normal flow, you can then modify its final position

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 if we dont set the attributes

21
Q

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

A

An absolutely positioned element no longer exists in the normal document flow

22
Q

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

A

it sits on its own layer separate from everything else

23
Q

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

A

by giving the parent element a position relative

24
Q

What are the four box offset properties?

A

top,right, bottom and left

25
Q

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

A

width and height

26
Q

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

A

viewport meta tag

27
Q

What is a breakpoint in responsive Web design?

A

its the point where the website changes view to be more responsive

28
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

percentage is more flexible then px