vault backup: 2022-10-24 17:48:08

This commit is contained in:
Jet Hughes 2022-10-24 17:48:08 +13:00
parent ced9913e82
commit 37388b6b19

View File

@ -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 <span> that is inside a <p>, which is inside an
<article> */
article p span { }
/* selects any <p> that comes directly after a <ul>, which
comes directly after an <h1> */
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