How to create a website
CSS
This is the presentation layer of a website
CSS is code which tells the browser how text and images should be presented on screen
There are 3 ways to insert CSS
- External style sheet - external CSS file connected to the HTML file
- Internal style sheet - added through - overwrites external style sheet if the same element is controlled by both.
- Inline style sheet - top level - defined within the tag of the element - overwrites other CSS files.
CSS can be called on:
- * - applies to everything
- body - applies to everything in the body
- h1/h2/h3 - applies to all elements that have h1/h2/h3 tags
- p - applies to all paragraph texts
- classes (.name) - applies to everything in a class with a given name
- div (#name) - applies to everything in a div with a given name
CSS can:
- change background color - e.g. background-color: yellow;
- change font color - e.g. color: yellow;
- change font size - e.g. font-size: 20pt;
- change font family - e.g. font-family:'Times New Roman'
- change border style - e.g. border-style: solid;
- change border width - e.g. border-width: 20px;