Professional Documents
Culture Documents
Heading
Paragraph
Markup Tags
(HTML)
Formatting
Final
Appearance
XHTML
Plain text contains all the content which will appear on the page.
Using a variety of formatting styles makes the text much easier to read
and can be used to emphasise points.
XHTML 01
Markup Languages
Browser Wars
Markup
HTML 1.0
Markup Language
A markup language consists of special tags which are placed in the text
Specifies how to format the text
Major problem
http://en.wikipedia.org/wiki/Browser_wars
XHTML 01
XHTML 01
Development of HTML
HTML 2.0
HTML 4.01
W3C recommendation (1999)
XHTML 1.0
W3C recommendation (2000)
http://en.wikipedia.org/wiki/Html
XHTML 01
Encoding methods
http://en.wikipedia.org/wiki/XHTML
XHTML 01
ASCII
UTF-8
Unicode
XHTML 01
XHTML 01
Overview of tags
Comments
Layout
XHTML 01
Attributes
XHTML 01
10
Nested Tags
Cannot close an open tag until all the open tags that it affects are also closed
<tag>
Text only affected by tag
<tag2>
Text affected by both tag and tag2
</tag2>
Text only affected by tag
</tag>
XHTML 01
11
XHTML 01
12
Essential tags
Essential tags
<html>
<head>
<html>
<head>
.
</head>
.
.
.
.
.
</html>
<html>
.
.
.
.
.
.
.
.
</html>
XHTML 01
13
XHTML 01
Essential tags
Essential tags
<title>
14
<body>
<html>
<head>
<title>Introduction to tags</title>
</head>
<body>
.
.
.
</body>
</html>
<html>
<head>
<title>Introduction to tags</title>
</head>
.
.
.
.
.
</html>
XHTML 01
15
XHTML 01
16
Block-level tags
Paragraphs
<p>
Headings
Paragraphs
Lists
Tables
Preformatted text
<html>
<head>
<title>Introduction to tags</title>
</head>
<body>
<p>This is a very simple web page</p>
<p>
It contains two different paragraphs
of text.
</p>
</body>
</html>
XHTML 01
17
XHTML 01
XHTML Exercise 1
18
Headings
Six levels of headings
<h1>
<h2>
<h3>
<h4>
<h5>
<h6>
Exercise 5: Create a complete XHTML document with the title Simple page.
The only text that should appear on the page is Hello World.
XHTML 01
19
XHTML 01
20
Headings
<html>
<head>
<title>Introduction to tags</title>
</head>
<body>
<h1>A very simple web page</h1>
<p>It contains two paragraphs and two
headings</p>
<h2>Second section</h2>
<p>This section is less important</p>
</body>
</html>
<h2>Head</h2>
<p>The head is not shown on the page</p>
<h2>Heading</h2>
<p>These come in different sizes
and make up the content of the page.
They should therefore be used only
in the body.</p>
<p>Do not get confused</p>
</body>
</html>
XHTML 01
21
XHTML 01
Unordered Lists
Ordered Lists
Unordered Lists
Bullet Points
<ul> </ul>
<li> </li>
22
Ordered Lists
Automatically numbered
Contains the entire list
<ol> </ol>
Used for each list item
<li> </li>
XHTML 01
23
XHTML 01
24
Definition Lists
Inline tags
<dl> </dl>
<dt> </dt>
<dd> </dd>
A definition term
A definition description
<p>Some definitions</p>
<dl>
<dt>HTML</dt>
<dd>Hypertext Markup Language</dd>
</dl>
XHTML 01
25
XHTML 01
Line break
26
Images
<br>
Solution
Backwards compatibility
XHTML 01
27
XHTML 01
28
<img> example
Image tag
<img>
<p>
Here is one of my holiday pictures.
<img src="Empire.jpg" alt="The Empire State Building>
</img>
It was late December and it was very cold.
</p>
src
The source file of the image
Attribute that specifies the file name
alt
Attribute to specify alternate text
Displayed if the image cant load
Important for people with visual impairment
XHTML 01
29
XHTML 01
Hypertext reference
30
URLs
Fully specified
<a>
Anchor tag
Protocol
Host name
Path
File
Relative
Omit the first parts
Path and file
File
href
Attribute used to specify the destination of the link
URL
http://www.cs.auckland.ac.nz/courses/compsci111/index.html
/courses/compsci111/index.htm
lectures/index.html
index.html
XHTML 01
31
XHTML 01
32
XHTML Exercise
Validated Code
XHTML 01
33
XHTML 01
34