Introduction to Cascading Style Sheets

by Yukong Zhang

Version Without Styles

Introduction

When you create a web page, you need to decide what to write on (contents) and what it would look like (styles). For a simple web page, we normallly mix both contents and styles together in a single page. However, a typical website consists of hundreds or thousands of web pages. It is desirable to make the web pages look consistently (similar styles). The "mix" approach would be a nightmare for web developers if the website needs to change its "look" regularly. A better approach is to separate styles from contents. Define styles in a separate file and apply it to multiple web pages.

Syntax of style sheets

  1. Selector
  2. A pair of curly braces
  3. Style name:value;
For example:
body
{
   background-color:lightblue;
   font-family:Arial;
}

The best way to learn CSS is to test out and to see web pages look like with different styles.
Best reference: www.w3schools.com

Example

2020 Fall Class Schedule
Class Class Name Class Time Classroom
ENG1301 Composition I 9:30-10:35 McFadden Building McF-205
CSC4341 Database Management Systems 10:40-11:45 Science and Technology Building STC-111
PHY1401 University Physics 12:30-1:35 McFadden Building PHY212
CIS3328 Windows Server Administration 1:40-2:45 McFadden Building McF-101

In the future robots will write computer code for humans. No programmers are needed.

Really? That is cool. Who write the code to program the robots?