Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
36 views
32 pages
Chapter 2 - Introduction To HTML
Uploaded by
doghork
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Download
Save
Save Chapter 2 - Introduction to HTML For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
36 views
32 pages
Chapter 2 - Introduction To HTML
Uploaded by
doghork
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Chapter 2 - Introduction to HTML For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 32
Search
Fullscreen
Chapter # 2
Introduction to HTML
Dr. Shaukat Ali
Department of Computer Science
University of Peshawar
HTML
• Hyper Text Markup Language is a formatting language
used to develop web pages.
• HTML language tells a Web Browser how to
format/represent the document i.e. where to put text, how
big to make the words, where to place pictures etc.
• HTML is not a programming language .i.e. it does not
have variable declaration, decision control structure and
loop.
• But, HTML is a language; as it has certain rule about
formatting the contents of a web page.
• HTML uses tags or markups to specify that how the
contents of a web page will be displayed.
Tags, elements and Attributes
• HTML uses tags or markups to specify that how the contents of a
web page will be displayed.
• A HTML tag is started with character “<“ followed by an element
and ends with character “>”. These characters are called angle
brackets.
• An element is a word that instructs to the browser that how to
format the content of the page coming after.
Example : <B>Shaukat Ali.</B>
• Element is surrounded by angle brackets.
• Attributes are the additional information about the element that is
included with the element inside the angle brackets.
• Some attributes are optional whereas come are compulsory.
• Example : <BODY BGCOLOR = “red”>, <TABLE ALIGN =
“center” >, <IMG SOURCE = “C:\\shooni\abc.jpg”> etc
Tags
• A HTML tag will be either single or paired tag:
Single Tag:
A tag that has only the opening tag but does not have the
closing tag.
Example : <HR>, <BR> etc.
Paired Tag:
A tag that has the opening as well as the closing tag.
Example : <BODY>----Some Text----</BODY>
The closing tag has the same element name but preceded
by “/”.
• HTML tag effects the contents coming between the opening and
closing tags.
• If a closing tag is missing, the browser will not report an error but
the page will not be displayed as expected.
• HTML tags can be written in both uppercase and lowercase.
• HTML tags can be nested and can be opened and closed in any
order.
• Example : <B><I>Shaukat Ali</B></I>
Benefits of HTML
• Simplicity:
HTML is a simple language. Any person can use HTML
easily to create web pages.
• Plateform Independent:
HTML works on any plateform (OS, Hardware).
HTML is text based language. Therefore HTML document
created for one type plateform can be used on different type of
plateform.
• Easy Navigation:
HTML web pages are linked together using hyperlinks. It
provides easy navigation form one page to another page.
• Attractive and Easier to Read:
HTML allows the use of graphics and animation. It delivers
richer contents and arranges the content creatively.
Limitation of HTML
• No Programming Capabilities:
HTML provides no programming capabilities.
It only provides formatted text, pictures and sounds
etc.
• Static:
HTML can only be used to create static web pages.
Creation of HTML Document
• HTML document is a file that contains tags and
informations (text, pictures) to be formatted.
• HTML file will have extension either .HTM or .HTML.
• The basic requirements to create HTML documents are:
Text Editor:
Text editor is used to write HTML commands
(tags).
Any simple text editor like Notepad or Worpad
can be used for this purpose.
Web Browser:
Web browser is used to test web pages.
Any web browser like Internet Explorer, Netscape
Communicator can be used for this purpose.
Basic Structure of a HTML Document
• HTML document starts with <HTML> <HTML>
and ends with </HTML> tags. <HEAD>
• HTML documents has TWO sections: <TITLE>
Head Section: -------
Head section contains tags -------
that has some control -------
information. Head Section
-------
The text between <TITLE>
and </TITLE> tags is -------
displayed at the title bar of the </TITLE>
browser. </HEAD>
Body Section: <BODY>
Body section contains the ---------
actual informations (text, ---------
graphics) that is to be
displayed in the display are of --------- Body Section
the browser. ---------
It also contains the tags for ---------
formatting the text to be </BODY>
displayed. </HTML>
Exapmle First Web Page
<BODY> Tag
• <BODY> ---- </BODY> tag contains the actual
informations to be displayed in the display area of the
browser.
• <BODY> has some attributes that will effect the whole
document:
BGCOLOR:
Specifies the background color of the web page.
BACKGROUND:
Specifies the background picture of the web page.
TEXT:
Specifies the color of text to be displayed in the
web page.
Example Attributes <BODY> Tag
Headings
• Headings are used to display different types of headings
in the <BODY> tag of HTML document.
• The opening tag for heading tag is <Hn> and the closing
tag is </Hn> where n is the size of heading and its value
can be from 1 to 6.
• The value 1 represents the largest and the value 6
represents the smallest heading size.
• Headings tag has an attribute:
ALIGN:
Specifies the alignment of the heading. The
possible values can be center, left and right. The
value left is by default.
Example Headings
Paragraphs <P> Tag
• <P> adds text to a document in such away that it will
automatically adjust the end of the lines to suit the
window size of the browser.
• Text to be displayed is written between <P> and </P>
tags.
• <P> tag also add and extra balnk line before and after the
paragraph.
• Attribute of <P> is:
ALIGN:
Specifies the alignment of the heading. The
possible values can be center, left and right. The
value left is by default.
Example <P> Tag
Line Breaks <BR> Tag
• Line break is used to decide that where the text will
break one a line or continue to the end of the window.
• Line break is used to break the current line and move the
control to the next line.
• The <BR> tag is used to end a line and it is single tag
(having no closing tag) and does not have any attribute.
Example <BR> Tag
Horizontal Line <HR> Tag
• Horizontal line <HR> tag is used to display a horizontal line in
the page to separate different areas of a web page.
• <HR> is a single tag (having no closing tag).
• <HR> tag attributes are:
ALIGN:
Specifies the alignment of the heading. The possible values
can be center, left and right. The value left is by default.
SIZE:
Specifies the size of the line in pixels. The default size is 2
pixels.
WIDTH:
Specifies the width of the line in either pixels or
percentage. The width of the line is according to the width
of the web page by default.
NOSHADE:
Turns off the shading of the line.
COLOR:
Specifies the color of the line.
Example Horizontal Line <HR> Tag
Text Formatting Tags
• Bold:
<B> tag is used to display text in bold face style.
Example : <B>Formatting make things cool.</B>
• Italic:
<I> tag is used to display text in italic style.
Example : <I>Italic text looks stylish.</I>
• Underline:
<U>tag is used to display text as underline.
Example: <U>Underline text look Prominent.</U>
• Superscript:
<SUP> tag is used to display text as superscript.
Ex: X<SUP>3</<SUP>.
• Subscript:
<SUB>tag is used to display text as subscript.
Example : H<SUB>2</SUB>O.
Example Formatting Text
<STRONG> and <EM> Tags
• <STRONG>---</STRONG> tag is an alternative to <B>--</B> tag.
• <EM>---</EM> tag is an alternative to <I>--</I> tag.
<CENTER> Tag
• <CENTER>---</CENTER> tag is used to center everything found
between them .i.e. Text, Image, Tables or any page element.
FONT<FONT> Tag
• <FONT> tag is used to specify the font name, size and color of
the text to be displayed.
• Text to be displayed is between <FONT> and </FONT>.
• <FONT> tag attributes are:
FACE:
Specifies the font of the text. Possible values are “Arial”,
“Arial Black”, “Courier” etc.
SIZE:
Specifies font size of the text. It can be from 1 to 7. The
default size is 3. The size 1 displays 8pt size, size 2
displays 10pt and so on.
COLOR:
Specifies the color of the text. Its value can either the color
name or the hexadecimal value of the color.
COLOR Example
Color Name. Hexadecimal Value.
Red. #FF0000
Green. #00FF00
Blue. #0000FF
White. #FFFFFF
Black. #000000
Gray. #808080
Dark Red. #800000
Dark Green. #008000
Yellow. #FFFF00
Example <FONT> Tag
Spaces and Character Entities
• If an HTML document has many spaces between two
words, additional spaces are removed automatically.
• If the user inserts Five spaces between two characters,
four of them will be removed automatically.
• Example: If I write <B>Hello World!</B>
It will be displayed as Hello World.
If I want more spaces, I will write it as
<B>Hello World!</B>
It will be displayed as Hello World!.
• Therefore if additional spaces are required, character
entity ( ) has to be used.
Character Entities
Entity Name. Description. Output.
Blank Space.
< Greater Than. <
> Less Than. >
& Ampersand. &
" Quotation Mark. "
¢ Cent. ¢
£ Pound. £
¥ Yen. ¥
§ Section. §
© Copyright. ©
® Registered Trademark ®
× Multiplication. ×
Example Character Entities
Preformatted Text <PRE> Tag
• Web browser normally while executing the HTML
stream back from the server ignores the carriage returns
(enter) pressed by the developer during writing text in
the web page.
• But, <PRE> tag is used to display the text as that has
been written by the programmer.
• The text to be displayed is written between <PRE> and
</PRE> tags.
Example <PRE> Tag
End of Chapter # 2.
You might also like
Web Technologies Notes: HTML Java Script CSS XML JDBC Servlets JSP
PDF
No ratings yet
Web Technologies Notes: HTML Java Script CSS XML JDBC Servlets JSP
98 pages
1 IDSS - Training G-IDSS Aug 13082013
PDF
0% (1)
1 IDSS - Training G-IDSS Aug 13082013
85 pages
Introdution To HTML
PDF
No ratings yet
Introdution To HTML
45 pages
Introdution To HTML
PDF
No ratings yet
Introdution To HTML
36 pages
Unit-1 HTML
PDF
No ratings yet
Unit-1 HTML
45 pages
Fswd@unit 1@aiml
PDF
No ratings yet
Fswd@unit 1@aiml
56 pages
HTML
PDF
No ratings yet
HTML
20 pages
Course Code: CSE 326 Internet Programming Laboratory
PDF
No ratings yet
Course Code: CSE 326 Internet Programming Laboratory
62 pages
Introduction To HTML
PDF
No ratings yet
Introduction To HTML
5 pages
Web Authoring (HTML)
PDF
No ratings yet
Web Authoring (HTML)
64 pages
UECS2094 2194 - Topic 2 - HTML - Jan 2025
PDF
No ratings yet
UECS2094 2194 - Topic 2 - HTML - Jan 2025
86 pages
HTML 5
PDF
No ratings yet
HTML 5
127 pages
Web U1
PDF
No ratings yet
Web U1
79 pages
Grade 9 ICT Skills Notes 1
PDF
No ratings yet
Grade 9 ICT Skills Notes 1
3 pages
CHSE 12TH HTMLNote
PDF
No ratings yet
CHSE 12TH HTMLNote
34 pages
HTML Final Show
PDF
No ratings yet
HTML Final Show
72 pages
HTML Unit 1
PDF
No ratings yet
HTML Unit 1
17 pages
Introdution To HTML
PDF
No ratings yet
Introdution To HTML
45 pages
INTRODUTION TO HTML CODING FOR WEBSITE DESIGN - by Engr Peter A Ogbeide
PDF
No ratings yet
INTRODUTION TO HTML CODING FOR WEBSITE DESIGN - by Engr Peter A Ogbeide
45 pages
Introduction To HTML
PDF
No ratings yet
Introduction To HTML
46 pages
Web Designing
PDF
No ratings yet
Web Designing
80 pages
Introduction To HTML
PDF
No ratings yet
Introduction To HTML
37 pages
Lecture 2
PDF
No ratings yet
Lecture 2
42 pages
Introdution To HTML
PDF
No ratings yet
Introdution To HTML
51 pages
2 - HTML1
PDF
No ratings yet
2 - HTML1
34 pages
Setup Instructions - TiviMate Player
PDF
75% (4)
Setup Instructions - TiviMate Player
19 pages
Introdution To HTML
PDF
No ratings yet
Introdution To HTML
45 pages
MM 1st Unit Notes Sum
PDF
No ratings yet
MM 1st Unit Notes Sum
30 pages
HTML
PDF
No ratings yet
HTML
53 pages
Introdution-To-Html Tags
PDF
No ratings yet
Introdution-To-Html Tags
45 pages
Introdution To HTML
PDF
No ratings yet
Introdution To HTML
45 pages
Chap 02 - Intro To HTML
PDF
No ratings yet
Chap 02 - Intro To HTML
32 pages
HTML Notes
PDF
No ratings yet
HTML Notes
29 pages
Introdution To HTML
PDF
No ratings yet
Introdution To HTML
47 pages
New Final HTML Note
PDF
No ratings yet
New Final HTML Note
23 pages
UNIT II Introduction of HTML
PDF
No ratings yet
UNIT II Introduction of HTML
10 pages
HTML and It's Properties
PDF
No ratings yet
HTML and It's Properties
24 pages
HTML Begin
PDF
No ratings yet
HTML Begin
13 pages
Wreath - TRYHACKME
PDF
No ratings yet
Wreath - TRYHACKME
119 pages
NetBackup11 UpgradeGuide
PDF
No ratings yet
NetBackup11 UpgradeGuide
211 pages
The Revu Tool Kit: Helpful Tips, Tricks & Shortcuts For Bluebeam Revu
PDF
No ratings yet
The Revu Tool Kit: Helpful Tips, Tricks & Shortcuts For Bluebeam Revu
27 pages
Css Practical 4
PDF
No ratings yet
Css Practical 4
8 pages
Assignment of Software Lab ON HTML (Hyper Text Markup Language)
PDF
No ratings yet
Assignment of Software Lab ON HTML (Hyper Text Markup Language)
19 pages
HTML Ppts
PDF
No ratings yet
HTML Ppts
21 pages
It Spring Edutech: Chapter 1: Getting Started With HTML
PDF
No ratings yet
It Spring Edutech: Chapter 1: Getting Started With HTML
12 pages
HTML
PDF
No ratings yet
HTML
43 pages
By Praveen Kumar Jha 1
PDF
No ratings yet
By Praveen Kumar Jha 1
27 pages
Introduction To HTML
PDF
No ratings yet
Introduction To HTML
13 pages
Tivoli: IBM Tivoli Workload Scheduler
PDF
No ratings yet
Tivoli: IBM Tivoli Workload Scheduler
194 pages
Top SEO Interview Questions Answers Guide
PDF
0% (2)
Top SEO Interview Questions Answers Guide
15 pages
Installing and Creating An Oracle Database 19c On Linux 7 With ASM
PDF
No ratings yet
Installing and Creating An Oracle Database 19c On Linux 7 With ASM
27 pages
MINI
PDF
No ratings yet
MINI
14 pages
Release Notes v3.2.2 - EcoStruxure Building Operation
PDF
No ratings yet
Release Notes v3.2.2 - EcoStruxure Building Operation
31 pages
Web Technology: Code:Cacs205 Facilitator Krishna Pd. Acharya
PDF
No ratings yet
Web Technology: Code:Cacs205 Facilitator Krishna Pd. Acharya
46 pages
HTML
PDF
No ratings yet
HTML
56 pages
Chapter 2
PDF
No ratings yet
Chapter 2
93 pages
HTML Tag
PDF
No ratings yet
HTML Tag
34 pages
Lesson 3 HTML
PDF
No ratings yet
Lesson 3 HTML
24 pages
HTML Put Question Bank
PDF
No ratings yet
HTML Put Question Bank
47 pages
Short Note For All G-12
PDF
No ratings yet
Short Note For All G-12
12 pages
Introdution To HTML
PDF
No ratings yet
Introdution To HTML
69 pages
Mom PDF
PDF
No ratings yet
Mom PDF
8 pages
Introdution To HTML Week2
PDF
No ratings yet
Introdution To HTML Week2
58 pages
Oracle FLEXCUBE UI Style Designer Oracle FLEXCUBE Universal Banking Release 11.4.0 (January) (2012)
PDF
No ratings yet
Oracle FLEXCUBE UI Style Designer Oracle FLEXCUBE Universal Banking Release 11.4.0 (January) (2012)
32 pages
June N000 COMPUTER PRACTICE FARMING N6 QP JUNE 2024 1
PDF
No ratings yet
June N000 COMPUTER PRACTICE FARMING N6 QP JUNE 2024 1
21 pages
Introdution To HTML: Srutipragyan Swain Assistant Professor, Comp - Sc. Department of CSE IMIT, Cuttack
PDF
No ratings yet
Introdution To HTML: Srutipragyan Swain Assistant Professor, Comp - Sc. Department of CSE IMIT, Cuttack
54 pages
Report
PDF
No ratings yet
Report
24 pages
WT HTML
PDF
No ratings yet
WT HTML
84 pages
Introdution To HTML
PDF
No ratings yet
Introdution To HTML
45 pages
HTML: HTML Stands For Hyper-Text Markup Language. It Allows Us To Create Web
PDF
No ratings yet
HTML: HTML Stands For Hyper-Text Markup Language. It Allows Us To Create Web
34 pages
Web Programming Chapter Two
PDF
No ratings yet
Web Programming Chapter Two
26 pages
Computer Science Notes
PDF
No ratings yet
Computer Science Notes
4 pages
Kirtan Resume
PDF
No ratings yet
Kirtan Resume
1 page
Hyper Text Markup Language
PDF
No ratings yet
Hyper Text Markup Language
36 pages
CTI TN-2015-09-07 Importing NOAA Tide Files PDF
PDF
No ratings yet
CTI TN-2015-09-07 Importing NOAA Tide Files PDF
13 pages
Coffee Cravings
PDF
No ratings yet
Coffee Cravings
11 pages
Article Archive - HTML5 Doctor
PDF
No ratings yet
Article Archive - HTML5 Doctor
10 pages
WD File
PDF
No ratings yet
WD File
59 pages
CLASS 7 Working With HTML 1
PDF
No ratings yet
CLASS 7 Working With HTML 1
23 pages
What Is HTML
PDF
No ratings yet
What Is HTML
20 pages
Second Periodical Test in Computer 9
PDF
No ratings yet
Second Periodical Test in Computer 9
4 pages
Luxury Scented Candles
PDF
No ratings yet
Luxury Scented Candles
3 pages
Riya Resume 09 08 PDF
PDF
No ratings yet
Riya Resume 09 08 PDF
1 page
Arp Command
PDF
No ratings yet
Arp Command
1 page
Introduction To Web Technology: Unit 3 HTML
PDF
No ratings yet
Introduction To Web Technology: Unit 3 HTML
49 pages
HTML Notes W3schools
PDF
100% (1)
HTML Notes W3schools
3 pages
Ajt Assignment-1
PDF
No ratings yet
Ajt Assignment-1
2 pages
HTML in 30 Pages
From Everand
HTML in 30 Pages
U.Q. Magnusson
4.5/5 (14)
Ultra HTML Reference
From Everand
Ultra HTML Reference
Mike Abelar
2/5 (1)
Hypertext Markup Language (HTML) Fundamentals: How to Master HTML with Ease
From Everand
Hypertext Markup Language (HTML) Fundamentals: How to Master HTML with Ease
Steven Bright
No ratings yet
Documents
Computers
Internet & Web