Cs-344: Web Engineering: Dr. Qaiser Riaz
Cs-344: Web Engineering: Dr. Qaiser Riaz
Outline
• Groups for assignments and semester project
• HTML
• Brief History
• HTML5
• Structure
• Syntax
• Elements
• Basic tags
3
HTML HISTORY
4
• He discussed
• The problems of loss of information
about complex evolving systems
• CERN put the World Wide Web software in the public domain
7
THE HTML
14
HTML
• HTML stands for HyperText Markup Language
Markup Language
• A markup language is a combination of text and a set of
symbols/tags
HTML Syntax
• The DOCTYPE
• Elements
• Attributes
• Comments
17
The DOCTYPE
• The <!DOCTYPE> declaration
• Must be the very first thing in an HTML document
• Its not an HTML tag
• An instruction to the web browser about what version of HTML the page
is written in
• In HTML 4.01, the <!DOCTYPE> declaration refers to a Document
Type Declaration (DTD)
• The DTD specifies the rules for the markup language, so that the
browsers render the content correctly
• HTML 4.01 was based on SGML (Standard Generalized Markup Lang.)
• HTML5 is not based on SGML
• Does not require a reference to a DTD
• Examples
• HTML5:
• <!DOCTYPE html>
• HTML 4.01
• <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
18
HTML Elements
• 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 - Fundamentals
• Paired Tags
• <name attributes> stuff </name>
• <b>text to be bolded</b>
• <h1>level 1 heading text</h1>
• Unpaired Tags
• <name attributes />
• <hr/>, <br/>
• <img src=“url” width=‘100px’ height=’60px’/>
• Comments
<!-- comment text -->
21
Header
Body
< / HTML>
22
<html>
<head>
<title> The title of your html page </title>
…
</head>
<body>
</body>
</html>
23
• My recommendations
• Notepad at initial stages
• Eclipse WTP, Netbeans at later stages
26
HTML – Fundamentals
<html>
<head>
</head>
<body>
Mike Tyler
PO Box 190387
Hungry Horse, Mt 59919
</body> Output
</html>
27
HTML - Fundamentals
<html>
<head>
</head>
<body>
<h1>Mike Tyler</h1>
PO Box 190387<br>
Hungry Horse, Mt 59919<br>
</body>
<html> Output
28
HTML - Fundamentals
Attributes
<html>
<head>
</head>
<body>
<font face=“Arial" color="red" size="3">
<h1>Mike Tyler</h1>
PO Box 190387<br>
Hungry Horse, Mt 59919<br>
</font> Output
</body>
<html>
29
HTML - Fundamentals
<html>
<head>
</head>
<body>
<p align="center">
<font face="Arial" color="red" size="3">
<h1>Mike Tyler</h1>
PO Box 190387<br>
Hungry Horse, Mt 59919<br></font> Output
</p>
</body>
<html>
30
HTML - Fundamentals
<html>
<head>
</head>
<body>
<p align="center">
<font face="Arial" color="red" size="3">
<h1>Mike Tyler</h1>
PO Box 190387<br>
Hungry Horse, Mt 59919<br></font>
<img src="file:///c:/mike.jpg"/>
</p>
</body>
<html>
Output
31
HTML - Fundamentals
<html>
<head>
</head>
<body>
<p align="center">
<font face="Arial" color="red" size="3">
<h1>Mike Tyler</h1>
PO Box 190387<br>
Hungry Horse, Mt 59919<br></font>
<img src="file:///c:/mike.jpg"/><br>
<a href=“biopage.html”>Read my Bio</a>
</p>
</body>
<html>
32
HTML - Fundamentals
Output
33
HTML – Fundamentals
Lists
What is Definition
List?
35
• Comments
• Comments are ignored by the browser and are not displayed.
• Make the code readable and understandable
<!-- This is a comment -->
37
Miscellaneous
#FF FF FF
Red Blue
Green
39
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
<ins> Defines inserted text
<del> Defines deleted text
<s> Deprecated. Use <del> instead
<strike> Deprecated. Use <del> instead
40
HTML STYLE
41
<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>
43
<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>
44
• Anchor Tag
• <a href=“url”> description </a>
http://citeseer.ist.psu.edu/2146170
45
• Target Attribute
• <a href=“url” target=“_blank”>…</a>
47
• CELLSPACING=value
• CELLPADDING=value
• WIDTH=value|percent
49
50
51
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>
52
Screen Compatibility
1280 x 1024
1024 x 768
800 x 600
640 x 480
HTML – Fundamentals: Tables
• Tables are frequently used to layout the basic web page design .
1280
640 53
Further Reading
• https://www.w3schools.com/html/html_tables.asp
• https://www.w3schools.com/html/html_styles.asp
• https://www.w3schools.com/html/html_lists.asp