HTML Lecture Complete
HTML Lecture Complete
(HTML)
By
Fahad Ahmed Satti
HTML =
Overview
HyperText
Markup
Language
2
What is HTML? (Theory)
• HTML Tags
– keywords surrounded by angle brackets like <html>
– Normally come in pairs like <b> and </b>
– The first tag in a pair is the start tag, the second tag is the
end tag
– Case insensitive
– Ignores white spaces and unknown attributes
• HTML Documents = Web Pages
– HTML documents describe web pages
– HTML documents contain HTML tags and plain text
– HTML documents are also called web pages
3
What is HTML? (Example)
This course is very hard. <p>This course is very hard.</p>
<html>
<body>
<p>This course is <b>very</b> hard.</p>
</body>
</html>
4
Self-Study: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference
HTML - Tags
• Open tags
– <name attributes/>
– <hr/>, <br/>
– <img src=“url” width=‘100px’
height=’60px’/>
• Closed tags
– <name attributes> stuff </name>
– <b>text to be bolded</b>
– <h1>level 1 heading text</h1>
• Comments
<!-- comment text -->
5
HTML – Document Structure
< HTML >
Metadata
HEAD
BODY Content
< / HTML>
6
HTML – Document Structure
< HTML >
<head>
<title> Web Engineering Example </title>
…
</head>
<body>
<! - - your web page content and markup - ->
<p>This course is <b>very</b> hard.</p>
</body>
< / HTML>
7
Authoring Tools
• WYSIWYG, Kompozer, Dreamweaver,
FrontPage, HomeSite
8
Building the 2 Web Page (1/6) nd
<html> Output
<head>
</head>
<body>
World Wide Web
The WorldWideWeb (W3) is a wide-area
hypermedia information retrieval initiative
aiming to give universal access to a large
universe of documents.
9
Building the 2 Web Page (2/6) nd
<html> Output
<head>
<TITLE>The World Wide Web project</TITLE>
</head>
<body>
<H1>World Wide Web</H1>
The WorldWideWeb (W3) is a wide-area
hypermedia information retrieval initiative
aiming to give universal access to a large universe
of documents.<BR>
10
Building the 2 Web Page (3/6) nd
<html>
<head>
Output
<TITLE>The World Wide Web project</TITLE>
</head>
<body>
<H1>World Wide Web</H1>
<A
The WorldWideWeb (W3) is a wide-area
NAME=0 HREF="WhatIs.html">hypermedia</A>
information retrieval initiative aiming to give universal access to a large
universe of documents.<br>
<html>
<head> Output
<TITLE>The World Wide Web project</TITLE>
</head>
<body>
<H1>World Wide Web</H1>
The WorldWideWeb (W3) is a wide-area <A
NAME=0 HREF="WhatIs.html">hypermedia</A> information retrieval initiative
aiming to give universal access to a large universe of documents.<br>
<H2>
<font face=“Arial" color="red" size="3">
Addendum
</font>
</H2>
<P>Thank you Tim Berners Lee</P>
</body>
</html>
12
Building the 2 Web Page (5/6) nd
<html>
<head> Output
<TITLE>The World Wide Web project</TITLE>
</head>
<body>
<H1>World Wide Web</H1>
The WorldWideWeb (W3) is a wide-area <A
NAME=0 HREF="WhatIs.html">hypermedia</A> information retrieval initiative
aiming to give universal access to a large universe of documents.<br>
<DIV align="center">
<H2>
<font face=“Arial" color="red" size="3">
Addendum
</font>
</H2>
<P>Thank you Tim Berners Lee</P>
</DIV>
</body>
</html>
13
Building the 2 Web Page (6/6) nd
<html>
<head> Output
<TITLE>The World Wide Web project</TITLE>
</head>
<body>
<H1>World Wide Web</H1>
The WorldWideWeb (W3) is a wide-area <A
NAME=0 HREF="WhatIs.html">hypermedia</A> information retrieval initiative aiming
to give universal access to a large universe of documents.<br>
<DIV align="center">
<H2>
<font face=“Arial" color="red" size="3">
Addendum
</font>
</H2>
<P>Thank you Tim Berners Lee</P>
<IMG src="https://www.w3.org/Press/Stock/Berners-
Lee/2001-europaeum-eighth.jpg" />
</DIV>
</body>
</html>
14
HTML Entities
• How can we add the following?
– Less than (<)
– Greater Than (>)
– Equal to (=)
– Space ( )
15
HTML Entities
Character Description Entity Name
non-breaking space
< less than <
> greater than >
& ampersand &
" double quotation mark "
single quotation mark
' '
(apostrophe)
© copyright ©
® registered trademark ®
Modern browsers are smart enough to render characters without using entities but for code clarity and to ensure
extended compliance these should be used.
e.g. <p> 0 <1 & 100> 1 => 0 <100</p> also produces the same output 16
rgb= Red,
18
HTML – Fundamentals
Horizontal Lines and Comments
• Horizontal Line
• The <hr /> tag is used to create an horizontal rule (line).
<p>This is a paragraph</p>
<hr>
• Comments
• Comments are ignored by the browser and are not
displayed.
• Make the code readable and understandable
<!-- This is a comment -->
Web Tech 1. Hypertext Markup
19
Language
HTML – Fundamentals
Text Formatting (not recommended , use CSS instead)
Tag Description
<b> Defines bold text
<big> Defines big text
<em> Defines emphasized text
<i> Defines italic text
<small> Defines small text
<strong> Defines strong text
<sub> Defines subscripted text
<sup> Defines superscripted text
The <ins> HTML element represents a range of
<ins> text that has been added to a document.
<del> Defines deleted text
Deprecated. Use <del> instead (strikethrough
<s> tag)
<strike> Deprecated. Use <del> instead
• <html>
• <body style="background-color : PowderBlue;">
• <h1>Look! Styles and colors</h1>
• <p style="font-family:verdana; color:red">
• This text is in Verdana and red</p>
• <p style="font-family:times; color:green">
• This text is in Times and green</p>
• <p style="font-size:30px">This text is 30 pixels high</p>
• </body>
• </html>
http://citeseer.ist.psu.edu/2146170
25
HTML – Fundamentals
Lists
26
27
HTML – Fundamentals
Tables
<TABLE BORDER=“1”>
<CAPTION ALIGN="bottom">Class Grades</CAPTION>
<TR>
<TH>Student</TH>
<TH>Grade</TH>
</TR>
<TR>
<TD>Tom</TD>
<TD>B+</TD>
</TR>
<TR>
<TD>Sue</TD>
<TD>A-</TD>
</TR>
</TABLE>
28
HTML – Fundamentals
Tables
• BORDER=value
• ALIGN=left|right|center
• CELLSPACING=value
• CELLPADDING=value
• WIDTH=value|percent
• Height = value only!
29
HTML – Fundamentals
Tables
<TABLE BORDER=1 WIDTH=“50%" CELLPADDING=“6” CELLSPACING=“2”
ALIGN="RIGHT">
<CAPTION ALIGN="bottom">Class Grades</CAPTION>
<TR>
<TH>Student</TH>
<TH>Grade</TH>
</TR>
<TR>
<TD>Tom</TD>
<TD>B+</TD>
</TR>
<TR>
<TD>Sue</TD>
<TD>A-</TD>
</TR>
</TABLE>
30
HTML – Fundamentals
Tables
31
HTML – Fundamentals
<TABLE BORDER=1 WIDTH="50%" CELLPADDING=5 ALIGN="center">
<TR>
<TD colspan=2 align='center'>
<font color="red"><b>Student Grades</b></font>
</TD>
</TR>
<TR>
<TD><b>Student</b></TD>
<TD><b>Grade</b></TD>
</TR>
<TR>
<TD>Tom</TD>
<TD rowspan=2>A</TD>
</TR>
<TR>
<TD>Sue</TD>
</TR>
</TABLE>
32
Screen Compatibility
1280 x 1024
1024 x 768
800 x 600
640 x 480
33
HTML – Fundamentals
Tables
• Tables are frequently used to layout the basic web page design.
1280
640 34
Questions?
THANK YOU