1-Basic HTML
1-Basic HTML
CS 3172
1
What is the WWW?
Perspective for this lecture
A distributed document delivery system
Uses a client-server model
Main presentation language is HTML
2
Client-Server Model
Two processes (possibly networked):
The client
Sends requests to the server
Blocks until reply is received
The server
Processes requests from clients
Never blocks
Can reply to several clients simultaneously
3
HTML
Hypertext Markup Language
Intended to be maximally portable
Logical markup
Graceful degradation of presentation
4
Markup Languages
Markup:
Embedded codes in documents
Codes are called `tags’
Codes
Describe the structure documents
Include instructions for processing
Markup language:
Computer language for describing syntax of tags
May be used with other tools to specify rendering
5
Logical Markup
Logical markup:
Describes parts of document
Does not specify how to render
Example:
This is <strong>very</strong> important
This is very important
6
Logical Markup
Presentation is client’s `decision’
When client cannot present then there
is graceful degradation
<img alt=“image description”
src=“foo.gif”>
Object example from Cougar
7
Some history
Gopher & the Internet Superhighway
SGML
GML + Charles Goldfarb = SGML
eXtensible Markup Language
HTML
8
Why HTML became XHTML
HTML was originally a SGML application
Tags described the syntax
A DTD could check the syntax
Informal mapping from syntax to rendering
Multiple incompatible versions arose
IETF moves at ’net speed not web $peed
Tag abuse was rampant in the ’net
They were a plague unto the users
9
Why HTML became XHTML (2)
If you think IMG is bad …
10
XHTML Basics
Very few real changes from HTML
But more strict
11
XHTML Basics
3 Parts to an XHTML or HTML document
DOCTYPE
What DTD are you using
Head
Meta information
Only <title> is required
Body
Text to render
12
XHTML Document Structure
13
XHTML Basics
Tags
Elements
Attributes
Entities
<,>,&,‘ ’
Ö,ð,÷,©, etc.
See example at CS3172 website
Comments
14
XHTML Tags vs. Elements
Tag is markup to represent an element
15
XHTML Tags vs. Elements
Block-level and in-line elements
TABLE, P, BLOCKQUOTE, DIV,
DIV etc.
CODE, Q, H1, SPAN,
SPAN etc.
Grouping Elements
DIV
SPAN
One-part elements
BR, etc.
16
XHTML Tags vs. Elements
Browser-specific tags
MARQUEE, BLINK, etc.
17
XHTML Basics
Tags may be nested but
Tags may not overlap
18
Overlap versus Nesting
19
Links — Why The WWW Is HT
‘A’ element
HREF TITLE
NAME ID
CLASS STYLE
REL Anchor Text
TYPE TABINDEX
URIs and URLs
RFCs
20
Where are the tools?
HTML Tidy
/opt/bin/tidy on torch
The validator
http://validator.w3.org/
http://www.cs.dal.ca/validator?
http://www.cs.dal.ca/validate?
http://www.cs.dal.ca:81?
21
XHTML/HTML Examples
XHTML element sampler
XHTML sample template
Both in the examples section of the website
22
For More About HTML
RFC 1866 (HTML 2.0) (at faqs.org)
Explains some of the philosophy behind HTML
So many choices!…
23
Which Standard to Follow?
Minimal standard for this course is
HTML 4.01 Transitional
Preferred standard is XHTML 1.0 or 1.1
24
Here endeth the lesson
25