CSS Introduction

The knowledge you need

Before continuing to study, you need to have a basic understanding of the following knowledge:


If you want to study these subjects first, on the home page to access the tutorials.

What is CSS?

  • CSS refers to Cascading Style Sheet ( C ascading S tyle S heets)
  • Style defines how to display HTML elements
  • Style is typically stored in a style sheet in
  • The style is added to HTML 4.0 to solve the problem of separation of content and presentation
  • External style sheets can greatly improve work efficiency
  • External style sheet is usually stored in a CSS file in
  • Multiple style definitions can be stacked into one

CSS examples

An HTML document can display different styles: 

see how CSS works

The style solves a big problem

HTML tags were originally designed to define the content of documents, as in the following example:

<h1> This is a heading </h1> <p> This is a paragraph. </p>

The style sheet defines how to display HTML elements, just like the font tags and color attributes in HTML do. The style is usually saved in an external .css file. We only need to edit a simple CSS document to change the layout and appearance of all pages.