From 37388b6b191ee27f7813096ca1f9f59b55fd0a69 Mon Sep 17 00:00:00 2001 From: Jet Hughes Date: Mon, 24 Oct 2022 17:48:08 +1300 Subject: [PATCH] vault backup: 2022-10-24 17:48:08 --- content/notes/css.md | 50 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/content/notes/css.md b/content/notes/css.md index 18fba4a63..47f704d28 100644 --- a/content/notes/css.md +++ b/content/notes/css.md @@ -5,4 +5,52 @@ tags: - cosc203 --- -Css is used to stylise [html](notes/html.md) webpages. +# Structure +```css +h1(selector) { + color(property): red(value/function); \ + font-size: 5em; / - declarations +} +``` + + +# Selectors +Types +- Universal: `*` +- Type: `main` +- Class: `.myclass` +- Id: `#myID` + +adjacent: `p + li {...}` +descendant: `p li {...}` + +```css +/* selects any that is inside a

, which is inside an +

*/ +article p span { } + +/* selects any

that comes directly after a

    , which +comes directly after an

    */ +h1 + ul + p { } +``` + +Pseudo Classes: +- `a:link {...}` +- `a:visited {...}` +- `a:hover {...}` +- etc + +Pseudo Elements +- `p::first-line {...}` + +## Specificity +Rules at a higher level of specificity will override a rule at a lower level + +Types +- Universal: 1 +- Type: 10 +- Class: 100 +- Id: 1000 + +# Tables +