1.1 HTML Fundamentals
1.1 HTML Fundamentals
Table of Contents
1.
Introduction to HTML
How the Web Works?
What is a Web Page?
My First HTML Page
Basic Tags: Hyperlinks, Images, Formatting
Headings and Paragraphs
2.
HTML in Details
The <!DOCTYPE> Declaration
The <head> Section: Title, Meta, Script,
Style
2
2.
3.
Client running a
Web Browser
Microsoft WebMatrix
Microsoft Expression Web
Microsoft Visual Studio
Adobe Dreamweaver
HTML Terminology
Tags, Attributes and Elements
HTML Terminology
Concepts
in HTML!
Tags!
Attributes!
Elements!
HTML Tags
Tags
Two
kinds of tags!
Opening!
Closing!
Opening tag
<html>
<body>
<h1>Hello Pesho!</h1>
</body>
</html>
Closing tag
Attributes
Attributes
10
And
11
HTML Elements
HTML
12
HTML Terminology
Live Demo
The
html element!
Head Element
The
What
is in there?!
Styles, scripts!
Declare encodings!
Etc..!
The title tag - the text in the tab of a
browser
16
body
17
HTML Basics
Text, Images, Tables, Forms
HTML Structure
22
23
24
25
26
HTML body
27
!
! <a href=http://www.itacad.org/"
! title="ITacad">Link to ITacad Web site</a>
Image Tags
<img src="logo.gif" alt="logo" />
28
Tags Attributes
Paragraph Tags
! <p>This is my first paragraph</p>
<p>This is my second paragraph</p>
33
!
!
<div style="background:skyblue">
This is a div</div>!
</body>
</html>
34
!
!
<div style="background:skyblue">
This is a div</div>!
</body>
</html>
35
Introduction to HTML
HTML Document Structure in Depth
Preface
38
Example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
"http://www.w3.org/TR/xhtml1/DTD/xhtml1!Transitional//EN"
transitional.dtd">
40
<meta>
<script>
<style>
<!- comments -->
42
43
45
scripts-example.html
<html>
<head>
<title>JavaScript Example</title>
<script type="text/javascript">
function sayHello() {
document.write("<p>Hello World!<\/p>");
}
</script>
</head>
<body>
<script type=
"text/javascript">
sayHello();
</script>
</body>
</html>
46
Using Scripts
Live Demo
48
Text Formatting
bold
italicized
underlined
<sup></sup>
<sub></sub>
<strong></strong>
Samplesuperscript
Samplesubscript
strong
<em></em>
<pre></pre>
emphasized
Preformatted text
20
Text Formatting
Live Demo
56
<a href="http://www.devbg.org"
target="_blank">BASD</a>
!
<a href="mailto:bugs@example.com?subject=Bug+Report">
Please report bugs here (by e-mail only)</a>
57
src="apply-now-button.jpg" /></a>
href="#section1">Go to Introduction</a>
...
! <h2 id="section1">Introduction</h2>
Hyperlinks Example
hyperlinks.html
<a href="form.html">Fill Our Form</a> <br />
<a href="../parent.html">Parent</a> <br />
<a href="stuff/cat.html">Catalog</a> <br />
<a href="http://www.devbg.org"
target="_blank">BASD</a> <br />
<a href="mailto:bugs@example.com?subject=Bug
Report">Please report bugs here (by e-mail only)</a>
<br />
<a href="apply-now.html"><img src="apply-nowbutton.jpg /></a> <br />
<a href="../english/index.html">Switch to English
version</a> <br />
60
Hyperlinks
Live Demo
id="section1">Introduction</h2>
Section 1 follows here ...
id="section2">Some background</h2>
Section 2 follows here ...
id="section2.1">Project History</h3>
Section 2.1 follows here ...
63
id="section1">Introduction</h2>
Section 1 follows here ...
id="section2">Some background</h2>
Section 2 follows here ...
id="section2.1">Project History</h3>
Section 2.1 follows here ...
64
Image attributes:
! src
! alt
height
!
width
! border
Example:
<img src="./php.png" alt="PHP Logo" />
52
Miscellaneous Tags
<center></center>: Deprecated!
! <center>Hello World!</center>
<font></font>: Deprecated!
<font size="3" color="blue">Font3</font>
<font size="+4" color="blue">Font+4</font>
67
68
Miscellaneous Tags
Live Demo
<ol type="1">
<li>Apple</li>
! <li>Orange</li>
<li>Grapefruit</li>
!</ol>
Apple
Orange
Grapefruit
A.
B.
C.
Apple
Orange
Grapefruit
a.
b.
c.
Apple
Orange
Grapefruit
i.
ii.
iii.
I.
II.
III.
Apple
Orange
Grapefruit
Apple
Orange
Grapefruit
70
o Apple
Apple
Orange
o Orange
Orange
Pear
o Pear
Pear
71
Lists Example
<ol type="1">
<li>Apple</li>
<li>Orange</li>
<li>Grapefruit</li>
</ol>
lists.html
<ul type="disc">
<li>Apple</li>
<li>Orange</li>
<li>Grapefruit</li>
</ul>
<dl>
<dt>HTML</dt>
<dd>A markup lang</dd>
</dl>
73
Creating Lists
Live Demo
HTML Entity
Symbol
Copyright Sign
©
®
Trademark Sign
™
Less Than
<
Greater Than
>
Ampersand
&
<
>
&
Non-breaking Space
Em Dash
—
Quotation Mark
"
Euro
€
British Pound
£
Japanese Yen
¥
"
61
76
77
Section Elements
Using <DIV> and <SPAN>
Block and Inline Elements
Example:
div-and-span.html
<div align=center style="font-size:24px;
color:red">DIV example</div>
<p>This one is <span style="color:red; fontweight:bold">only a test</span>.</p>
81
<DIV>
<DIV>
Live Demo
span.html
<p>This one is <span style="color:red; fontweight:bold">only a test</span>.</p>
<p>This one is another <span style="font-size:
32px; font-weight:bold">TEST</span>.</p>
83
<SPAN>
Live Demo
<SPAN>some text</span>
</head>!
id="header"> </div>!
id="navigation"> </div>!
id="sidebar"> </div>!
id="content"> </div>!
id="footer"> </div>!
34
Remember
It
The W3C
HTML Basics
Questions?
?
Exercises
1.
93
Exercises (2)
2.
!
!
!
!
!
!
3.
Exercises (3)
95
Exercises (4)
4.
96
Exercises (5)
Create a Web site like the following:
5.
!
!
!
!
!
!
!
97