CSS Introduction

Knowledge you need

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


Why Use CSS?

  • CSS refers to Cascading Style Sheets ( C ascading S tyle S heets)
  • Style definitions How to display HTML elements
  • Styles are usually stored in style sheets
  • Styles were added to HTML 4.0 to solve the issue of separation of content from presentation
  • External style sheets can greatly improve work efficiency
  • External style sheets are usually stored in CSS files
  • Multiple style definitions can cascade into one

Style solves a big problem

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

<h1>This is a heading</h1>

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

Style sheets define how HTML elements are displayed, just as font tags and color attributes in HTML play a role. Styles are usually saved in external .css files. We only need to edit a simple CSS document to change the layout and appearance of all pages.