CSS Introduction
Knowledge Requirements
Before proceeding with your studies, you need to have a basic understanding of the following:
- HTML / XHTML
If you wish to learn these topics first, please visit the relevant tutorials on the homepage.
What is CSS?
CSS stands for Cascading Style Sheets
Style defines how to display HTML elements
Styles are typically stored in style sheets
Adding styles to HTML 4.0 was meant to address the issue of content and presentation separation
External style sheets can greatly enhance work efficiency
External style sheets are usually stored in CSS files
Multiple style definitions can be cascaded into one
CSS Examples
An HTML document can display different styles: See how CSS works
The Problem Solved by Styles
HTML tags were originally designed to define document content. For example:
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
Style sheets define how to display HTML elements, similar to the role of font tags and color attributes in HTML. Styles are usually saved in external .css files. By editing a single simple CSS document, we can change the layout and appearance of all pages.