CPD CS-12 Advanced Web Design For Teachers

CPD CS-12 Adv. Web Design for Teachers << HTML & XHTML >>

Tobias Gelston, <Tobiasg@gmail.com>

Mode: Static :: Switch to Presentation

Vocabulary Basics

A little something to get us started

<html>
<head>
<title>
Some Title
</title>
</head>
<body>
Your content here
</body>
</html>
XHTML vs. HTML

XHTML vs. HTML

My markup language can beat up your markup language:

You have heard of HTML, but what is XHTML?

 

XHTML is Almost Identical

XHTML is Almost Identical?

Creating well formed documents:

Good XHTML Habits

Good XHTML Habits

Give it to me straight, doc - what do I need to do?

Properly nest ALL tags (Draw imaginary lines from the opening to closing tag. Those lines must not cross any other lines.)

nested correct

nested wrong

Well-formed documents simply means you use all necessary tags and attributes (Doctype & XML attribute)

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

Close ALL tags

<p>Close It</p>    If tag is solo <br /> close it with space and slash - <hr /> <img />

lowercase

All attributes MUST be quoted

Special characters must be converted (e.g. NO &, USE &amp; instead)

All content MUST be inside a BLOCK level element (e.g. <p> or <div>)

Doctype

<!Doctype>

Avoid the quirks!

Doctype is necessary for writing valid, standards-based code. The doctype communicates to the browser the version of XHTML that you are using. If the browser doesn't know the doctype you are using it can switch to quirks mode and the resulting output (display) can be unexpected.

Multiple Document Types are available

XHTML 1.0 Strict (Recommended)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

XHTML 1.0 Transitional

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

HTML 4.01 Strict

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

Pick one, stick it at the top of your document and move on!

Head Section

The <head> Section

2nd Floor: title, Meta Tags, CSS links and housewares

Web pages can be divided into two sections; head and body. The head section contains all the behind the scenes information. The most common are listed below.

Title - appears on the title bar of the browser

<title>Web Page Example</title>

Meta Tags - provide information that is not visible to browsers. Common meta tags relevant to search engines are keyword and description tags.

<meta name="description" content="" />  
<meta name="keywords" content="" />  
<meta name="author" content="" />

CSS - inline style or the CSS links

<link rel="stylesheet" href="" media="screen,projection" type="text/css" />  
<link rel="stylesheet" href="" media="print" type="text/css" />
Body Section

The <body> Section

3rd Floor: Content is King

Web pages can be divided into two sections: head and body. The body section contains the content!

Remember:

 

common tags

Commonly Used Tags

Tag Soup. . .yum!

A few tags to get us started: