CSS
What is CSS?
CSS (Cascading Style Sheets) is a language that allows you to create the style and layout of web pages, you can control exactly how HTML elements look in the browser, presenting your markup using whatever design you like. For example changing the color and size of headings and links.
CSS Syntax
CSS is a rule-based language, you define the rules by specifying groups of styles that should be applied to particular elements or groups of elements on your web page.
Selectors
A CSS selector is the part of a CSS rule that describes what elements in a document the rule will match. The matching elements will have the rule’s specified style applied to them.
HOW TO ADD CSS
You can add CSS creating a file known as style sheet. A browser reads it and formats the HTML document according to the information in the style sheet.
Ways to Insert CSS
- External CSS: Changes the look of an entire website by changing just one file.
- Internal CSS: Changes the look of a single HTML page.
- Inline CSS: Changes the look of a single element.
CASCADING ORDER
The cascade order refers to the way styles begin at the top of the page and, as they cascade down, collect and replace each other as they are inherited. The general rule of thumb is that the last style defined is the one that is used.