From 7b57811b743336ae915a1492a2f72733d77c9f02 Mon Sep 17 00:00:00 2001 From: Jet Hughes Date: Mon, 24 Oct 2022 18:03:08 +1300 Subject: [PATCH] vault backup: 2022-10-24 18:03:08 --- content/notes/css.md | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/content/notes/css.md b/content/notes/css.md index 47f704d28..2a193fa0d 100644 --- a/content/notes/css.md +++ b/content/notes/css.md @@ -14,6 +14,8 @@ h1(selector) { ``` + + # Selectors Types - Universal: `*` @@ -21,8 +23,14 @@ Types - Class: `.myclass` - Id: `#myID` -adjacent: `p + li {...}` -descendant: `p li {...}` +Combining +- grouping: `p, li` +- adjacent: `p + li` +- descendant: `p li` +- direct descendant: `div > h1` +- general sibling: `div ~ h1` +- chaining: `.class1.class2` +- attribute: `div[lang]` ```css /* selects any that is inside a

, which is inside an @@ -43,14 +51,34 @@ Pseudo Classes: Pseudo Elements - `p::first-line {...}` +## Inheritance +Some properties like color are inherited by some children elements. width, margin, padding, border are not inherited + +Controls +- inherit: sets property to the same as parent element +- inital: sets property value to inital/default value of that property +- unset: sets property to natural value (inherit or dont inherit) + +## Cascade +Three rules - higher ones overrule lower ones +- Importance +- Specificity +- Source Order (only matters if specificity is the same) + ## Specificity Rules at a higher level of specificity will override a rule at a lower level +ID > class > element. + Types - Universal: 1 - Type: 10 - Class: 100 - Id: 1000 -# Tables + + + +# Media Queries +