Other Flashcards

1
Q

What is the order of execution for CSS?

Class selector, element selector, ID selector, Inline, *, !Important

A

1 !Important Will overrule everything

2 Inline style Higher order than other CSS but you should never use this

3 ID selector In case of multiple: Last selector applies

4 Class selector
In case of multiple: Last selector applies
Pseudo classes take preference over more generic element selectors!

5 Element selector
In case of multiple: Last selector applies
The element level is important. A lower level element takes precedence over a higher level element

6 Universal selector *

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

What type of CSS properties do typically receive inheritance from their parents?

A

font-family
line-height
text-align
text-transform
color
font-size

The properties that do receive inheritance from their parents are mostly related to text

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

Example of property that is not affected by inheritance

A

Properties like height, width, margin, padding, and border are not inherited properties.

A lot of selectors will not be affected by inheritance such as border. It would be unworkable otherwise

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

Check whether HTML is valid

A

With W3C Validator you can check whether your HTML is valid

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

Conflict in element?

A

In the Chrome browser inspect module you can check what is wrong with the element.
It could be referenced two times for example
Rule of thumb: When there’s conflict somewhere it’s typically the more complex class rule that is applied
Therefore: Keep your selector as simple as possible

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

Compare two different pieces of code

A

Diffchecker

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

Selector specificity

Ex:
Selector specificity: (0,1,0)
vs.
Selector specificity: (0,2,2)

A

Hoover over selector in Visual Code Studio and check number. When there’s conflict, the heighest number decides which takes preference

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

Box model final element width

A

Left border + left padding + width + right padding + right border

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

Box model final element heigth

A

top border + top padding + height + bottom padding + bottom border

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

The specificity algorithm is basically a three-column value of which three categories?`

A

ID, CLASS, and TYPE

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