Skip to main content
table of contents
Introduction to Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS) is a way to add flair to a web page. It is used to describe the presentation of a doc ument written in HTML, it enables separation of presentation and content.
Table of Contents
This guide contains these parts:
- Grammar
- CSS Selectors
- Organizing CSS declarations
- Inline
- Style Tag
- Linking external style sheets
- CSS Frameworks
- CSS Preprocessors
- Examples
- Practice
- Bibliography
Main concepts
This guide introduces these main concepts:
1.1. CSS Selectors
In CSS, selectors declare which part of the markup a style applies to by matching tags and attributes in the markup itself.
- id
- class
- elements
CSS specificity depends on the HTML structure. It's a tree-based inheritance.
1.2. CSS blocks
A CSS block or declaration in CSS is contained in a pair of curly braces.
Suggested Reading:
- “CSS: The Definitive Guide” https://dailydevlinks.com/css-style-guides/
- CSS Basics https://en.support.wordpress.com/custom-design/css-basics/
- Appendix G. Grammar of CSS 2.1 https://www.w3.org/TR/CSS21/grammar.html
Annotate
Web Technology