Design web pages with CSS
What is CSS
CSS (Cascade Style Sheets) is the style and furniture of a house in comparison with HTML being the structure of it.
Browser has defaults fro html.
Document examples:
- HTML
- SVG
- XML
Presenting:
- Browsers
- Firefox
- Chrome
- Edge
CSS affects:
- color
- size
- single column into txt layout
- animation
CSS Syntax:
- Selector
- Braces{}
- Declarations
- Property
- Value
There’s so many codes, therfore broken down by modules.
Everythign is run by CSS Working Group in W3C.
Browser compatibility is important.
How to Add CSS
Three ways to add CSS:
- External CSS:seperate file with link to html file
- Internal CSS:CSS code with one unique HTML file
- Inline CSS- CSS code applied directly to HTML file
-
This is a heading
This is a paragraph.
Cascade Style
-
- Inline style (inside an HTML element)
- External and internal style sheets (in the head section)
- Browser default
Inline takes priority
CSS Color Property
body { color: red; }
h1 { color: #00ff00; }
p.ex { color: rgb(0,0,255); }