Lecture 3: HTML & CSS Basics Flashcards

1
Q

Why do we need CSS?

A

You need CSS to communicate efficiently, and it also helps to build the user experience which then helps with prototyping

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

CSS Anatomy

A

selector-type {
Property: value;
}

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

CSS Standard Selectors

A

Element selector, class selector (. - multiple), id selector (# - unique)

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

How does CSS read HTML?

A

<link rel=”stylesheet” href:”./stylesheet.css” type=”text”>

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

Descendant selector:

A

(SPACE) .shopcart a {
}

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

Grouping Selectors

A

(Commas) p, br, span {
}

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

Pseudo class Selectors

A

Enabling styling based on user-interaction, eg. hover.
Eg. element:pseudo-class {}
Eg. a:active { color: aqua; }

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

Origin precedence rule

A

last rule wins! The file is parsed top to bottom.

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

Inheritance rule:

A

child element in its parents rules, unless declared otherwise

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

Specificity rule

A

more specific rules win. You could use the counter to understand the specificity on the css rule eg. (0,0,2) is more specific than (0,0,1).

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

Final hierarchy:

A

Inline style > ID > Class > elements
!important takes complete precedence but its bad practice

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

Box Model:

A

This makes everything apply inside the box, only the margin is still applied to the outside.
Good practice: Most generic styles go to the top of the css file and then as you go lower it gets more specific.

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

Box Model Code

A

content-box (default)
* {
box-sizing : border-box;
}

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

Content Spilling Over

A

overflow: visible; overflow: hidden; overflow: scroll; overflow: auto;

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

Flexbox

A

.container {
flex-flow: column wrap;
display: flex;
}

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

Flexbox Properties

A

Justify content, align items, align content