Intro to CSS (1 of 2) Flashcards

1
Q

1) When the author describes the benefits of CSS, what does he say CSS controls?

A

CSS controls the appearance of a website. By having CSS separate from HTML, you don’t have to change the structure to change the appearance of the website.

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

2) [True or False] Styles are applied in the order in which they are found, cascading down from external to local styles.

A

True

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

3) Why do browsers give end users so much control over how the page is viewed?

A

Goal of any website is to make the content accessible to the individual user. Browsers allow users to change the contrast ratio or font size of a website to fit users’ needs.

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

4) What 2 parts make up a CSS rule?

A

Property and value

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

5) What separates the property from the value in a CSS rule?

A

Colon

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

6) As described by the author, what type of selector is global in nature?

A

Element selector

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

7) [Critical Thinking] Write a selector that only applies to p tags with a class named blue.

A

p.blue { Color: black }

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

8) [True or False] descendant selectors apply to any nested element, no matter how deep it’s found within the page structure.

A

True

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

9) [Critical Thinking] Write an example of a group selector.

A

h1, h2, p {

}

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

10) [True or False] The author advises to try to structure your code to add meaning to the content, without even thinking of the styling.

A

True

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

11) Where are embedded styles typically located?

A

Located in the head block of a document

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

12) Why does the author discourage the use of inline styles?

A

Hard to overwrite and maintain over time. It’s cumbersome and inefficient to track down a line of code with inline styles.

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

13) What is the single sentence the author gives that sums up how rules are applied?

A

The last rule applied wins!

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

14) [True or False] Inheritance says that the child element will inherit the properties applied to the parent.

A

True

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

15) What does it mean when the author says that styles are cumulative?

A

Style rules add up. Broad selector-declarations are applied first, then more specific selector-declaration modifies last inherited rule.

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

16) What are at least two ways to ensure you CSS looks good everywhere?

A

Use caniuse.com to find what CSS features are not supported in certain types of browsers. BrowserStack will render your webpage in multiple types of browsers and provide you with a screenshot to compare how your website is rendered across many browsers.

17
Q

17) [Critical Thinking] Between normalize and reset stylesheets do you think you would use and why?

A

I would use normalize stylesheet since normalize removes some of the default browser stylings, but keeps useful ones. Once I get a better grasp of CSS, I will use reset stylesheets so I have full control of how all the stylings are rendered on a webpage.

18
Q

18) Why does the author specify fallback fonts?

A

System fonts are fonts that are pre-installed on the computer. Use the system fonts as a fallback font when desired font is not available on browser/device.

19
Q

18) What do margins represent and define?

A

Margin represents the space around an element and is used to define the space between elements.

20
Q

19) How many properties does the border have?

A

Three: border-width, border-style, border-color

21
Q

20) [True or False] Padding is the space added to an element outside the border and is part of the overall width and height of an element’s calculation.

A

False, Padding is the space added to an element inside the border and is part of the overall width and height of an element calculation.

22
Q

21) [Critical Thinking] The box sizing property accepts two values - which would you use and why?

A

The two values are content box or border box. I would use border box value since the width of my element will be exactly the width I set. Content box width will be the value I set plus border and padding widths on both sides.

23
Q

22) [Critical Thinking] How does additional padding effect an element set to a width of 100% inside a parent element?

A

If an element’s width is set to 100%, the element will base the percentage size on the parent elements width. Since the content box is the default box sizing , the width of the content box will be the same size as the parent element’s width. Any additional padding will be added outside the content box size.

24
Q

23) Which margins potentially collapse, horizontal or vertical?

A

Vertical

25
Q

24) [Critical Thinking] Show an example rule that sets all 3 border properties to all 4 borders of an element.

A

p { Border: 2px solid red; }

26
Q

25) When does the outline property provide?

A

Outline property is frequently used for accessibility reasons to allow users to tab through a website. Outline property does not affect the position of nearby elements and can be hidden behind visuals with information for search engines to pick up.