Intro To HTML
Intro To HTML
Outline
Introduction
Editing HTML
First HTML Example
W3C HTML Validation Service
Headers
Linking
Images
Special Characters and More Line Breaks
Unordered Lists
Nested and Ordered Lists
Web Resources
1
Objectives
2
1 Introduction
A markup language
3
2 Editing HTML
Start tag
End tag
5
<!-- Fig. 4.1: main.html -->
Comments <!-- Our first Web page -->
<html>
<head>
Head section Start tag
</head>
<body>
Body section end tag
</body>
</html>
6
Example1: First HTML example: main.html
<html>
<head>
<title>Internet and WWW How to Program - Welcome</title>
</head>
<body>
<p>Welcome to XHTML!</p>
</body>
</html>
7
5 HTML Header Elements
Six headers ( header elements): h1 through h6
<body>
<h1>Level 1 Header</h1>
<h2>Level 2 header</h2>
<h3>Level 3 header</h3>
<h4>Level 4 header</h4>
<h5>Level 5 header</h5>
<h6>Level 6 header</h6>
</body>
9
Example3: Linking to other Web pages: links.html
<body>
<p><a href = "http://www.deitel.com">Deitel</a></p>
<p><a href = "http://www.prenhall.com">Prentice Hall</a></p>
<p><a href = "http://www.yahoo.com">Yahoo!</a></p>
<p><a href = "http://www.usatoday.com">USA Today</a></p>
</body>
User click
10
Example 4: Linking to an e-mail address: contact.html
<p>
My e-mail address is
<a href = "mailto:[email protected]"> [email protected]</a>
. Click the address and your browser will
open an e-mail message and address it to me.
</p>
11
7 Images
Empty elements
Terminated by character / inside the closing right angle bracket
(>), or by explicitly including the end tag
12
Example 5: Images in XHTML files: picture.html
<p>
<img src = "xmlhtp.jpg" height = "238" width = "183"
alt = "XML How to Program book cover" />
<img src = "jhtp.jpg" height = "238" width = "183"
alt = "Java How to Program book cover" />
</p>
13
Example 6: Images as link in anchors: nav.html
links.html
14
8 Special Characters and More Line Breaks
15
Example 7: Special characters in HTML: contact2.html
16
9 Unordered Lists
Unordered list element: ul
li (list item)
Entry in an unordered list
17
Example 8: Unordered lists in HTML: links2.html
<ul>
<li><a href = "http://www.deitel.com">Deitel</a></li> add four list items
18
10 Nested and Ordered Lists
Ordered lists: ol
Creates a list in which each item begins with a number
19
<ul>
Example 9: Nested and ordered lists in HTML: list.html
<li>New games</li>
<li>New applications nested ordered list
<ol>
<li>For business</li> Another nested ordered list
<li>For pleasure</li>
</ol>
</li>
<li>Around the clock news</li>
<li>Search engines</li>
<li>Shopping</li>
<li>Programming
<ol>
<li>XML</li>
<li>Java</li>
<li>XHTML</li>
<li>Scripts</li>
<li>New languages</li>
</ol>
20
</li>
11 Web Resources
www.w3.org/TR/xhtml11
www.xhtml.org
www.w3schools.com/xhtml/default.asp
validator.w3.org
hotwired.lycos.com/webmonkey/00/50/index2a.html
wdvl.com/Authoring/Languages/XML/XHTML
www.w3.org/TR/2001/REC-xhtml11-20010531
21