43. The Cascade - Specificity and Inheritance

Untitled

4. Position

The lower down the script, code gets higher position

3. Specificity

  1. element

  2. class

  3. attribute

  4. id

2. Type

  1. external

  2. internal

  3. inline

1. Importance (css keyword)

color: green !important;

44. Combining CSS Selectors

💡 You can also COMBINE COMBINERS

45. CSS Positioning

1. Static

Default location (not overlapping with other elements)

2. Relative

Relative to static (default location)

3. Absolute

Position relative to nearest positioned (meaning position property set) ancestor or top left corner of webpage

💡 Takes element out of the original HTML flow and puts it on another layer (On top of everything, meaning higher z-index)

🔤 z-index : towards(+)/away(-) from screen