Lec 2
Lec 2
Web Development
Module 2 – HTML Part 1
Contents
• HTML Document Structure and Markup Basics
• HTML Doctypes and Templates
• HTML Elements
– Comments
– Heading and Paragraph
– Phrase Tags and Special Characters
– Lists and Table
– Anchor and Image
• HTML Development Process
2 - Web Development, © Swinburne
What is HTML ?
HTML = HyperText Markup Language
ie. “HyperText” using a “Markup Language” !
• Simple text that uses markup code
to define the structure and content of the page.
<h1>This is a heading</h1>
<p>This is a paragraph with a <a href="…">link</a>
and an image <img … /></p>
<form> … </form> DEMO!
<table> … </table> and more … index.html
<head> </head>
<title>...</title> <body>
</head>
<body>
</body>
</html>
<h1>…</h1>
<hr />
<p> … </p>
<p> … </p>
HTML Element
Start Tag Element Content End Tag
Attributes
<h1 id="intro">Introduction Heading</h1>
Tag
Attribute Attribute
Name
Name Value
inline elements.
• Block-level elements would normally be
displayed on a new line in the web page, e.g.,
<h1>, <table>, <p>.
• Inline elements are displayed within block-
level elements without starting a new line,
e.g., <a>, <img>, <em>.
<p>This is a paragraph about <em>The Matrix</em></p>
</body>
</html> Replace the highlighted text with your code.
DEMO!
heading.html
DEMO!
<h1>HTML</h1>
<p>HTML is a markup language
for describing the contents
and structure of web
pages.</p>
<hr />
<h1>CSS</h1>
<p>CSS defines the style or
how to present the contents
and structure of web
pages.</p>
DEMO!
<ul>
<li>first item</li>
<li>second item</li>
<li>third item</li>
</ul>
The inner list must be inside a list item of the outer list.
<dt>Selfies per
Minute</dt>
<dd>Unit of
measurement for
narcissism.
</dd>
</dl>
<a
href="http://www.swinburne.edu.au/contac
ts-
campuses/campuses/hawthorn/documents/haw
thorn.pdf">Hawthorn Campus Map</a>
Click <a
href="mailto:[email protected]">here
</a> to contact Nathan.
<a
href="http://en.wikipedia.org/wiki/Smile
y">
<img src="smiley.jpg" alt="Smiley Face"
/></a>
DEMO!
60 - Web Development, © Swinburne anchor.html
HTML: Image Element
• <img … /> is an inline element that defines an
image in an HTML page.
– Must have the two required attributes: src and
alt
<img src="images/logo.jpg" alt="Swinburne Logo Image“ />