Let's start from CSS.

What is CSS?

Cascading Style Sheets. 级联样式表单。

Nothing New.

Generally accepted. Widely used.

Why is CSS used?

Several reasons:

What is HTML then?

Brief history

developed by Tim Berners-Lee for more convenient file sharing and cross-linking. It stands for Hypertext Markup Language. A language which is meant to describe the structure and content of your document.

When did <table/> used for layout start?

Two reasons:

So why this session?

To do the web the right way!

It's all cliche though.

Meet the standards

But,

Dogma vs. Pragmatism

HTML: Past & Present

Current problems

HTML Past: Whatever Looked Good

What is recommended then?

HTML Present: Scaffolding for CSS

back to our title: HTML + CSS. Introducing the two mighty tag: <div> & <span>

The <div> tag and the <span> tag are like empty vessels that you fill with content.

where the hell is the so-called standard anyway?

A checklist.

Proof

well, sort of. Assume you want a page looks like this.

what you want

spaghetti

spaghetti

a rather neet one

neet

One more thing

if HTML 4.01 Transitional,

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.
	w3.org/TR/html4/loose.dtd">
    

if XHTML Transitional,

      	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
	w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    

If you want more detail, please refer to my blog post `about a problem I once encountered' and the famous Quirksmode.org(actually it features a lot of things rather than several compatibility tables).

How about CSS?

the structure of CSS.

CSS Context

Where to write style?

external file

      <link rel="stylesheet" type="text/css" href="css/global.css">
    

interal style

      <head><style type="text/css">@import url(base.css)</style>
    

inline style

      <p style="padding: 5px 0;">Hello world.<p>
    

selector

by

tag. Page-Wide Styling

      h2 { font-weight: normal; }
    

class. Prinpoint Control

      .clear { clear: both; }
    

id. Specific Page Elemets

      #banner { background: #CC0000; }
    

let's move on

chaining sample

select specific item

Styling multiple element

Inheritance & Cascade

will be discussed in detail with samples later.

CSS applied

Formatting text

Box mode

Box

a few samples.

mission one: style link.

mission two: make a navigator.

mission three: layout.

Questions?

Thank you.