CSS start

what is CSS

CSS (Cascading Style Sheets) allows you to create great-looking web pages, but how does it work under the hood? This article explains what CSS is, with a simple syntax example, and also covers some key terms about the language.


  1. CSS selector
  2. use CSS beautify web pages
  3. CSS Box Model
  4. CSS float
  5. CSS position
  6. Web animation

CSS selector

The selectors are defined in 'style' element in HTML web page, or can be defiend in CSS file, 'name.css'. A selector contains name and {style: style_define;}. Selector name could be a element name or a customized class name which can be stated as attribute 'class="name"' in element. To import a bunch of CSS selectors, use 'link' element.
eg.
<style>
 h1{
  color: red
 }
</style>
After writing css in style.css, it can be imported by 'link'. <link rel="stylesheet" href="./css/style.css" />

Why should CSS be separated from HTML

  1. Make code more structual
  2. CSS Repeatly used for other HTML web pages
  3. Higher code maintainability