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)
21 views
Chapter 2 - Introduction To HTML
Uploaded by
doghork
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download now
Download
Save Chapter 2 - Introduction to HTML For Later
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)
21 views
Chapter 2 - Introduction To HTML
Uploaded by
doghork
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download now
Download
Save Chapter 2 - Introduction to HTML For Later
Carousel Previous
Carousel Next
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
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
Ultra HTML Reference
From Everand
Ultra HTML Reference
Mike Abelar
2/5 (1)
Data Centre Design Consultant (DCDC)
PDF
0% (3)
Data Centre Design Consultant (DCDC)
12 pages
Introduction To HTML
PDF
No ratings yet
Introduction To HTML
37 pages
MM 1st Unit Notes Sum
PDF
No ratings yet
MM 1st Unit Notes Sum
30 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
Introdution-To-Html Tags
PDF
No ratings yet
Introdution-To-Html Tags
45 pages
Web U1
PDF
No ratings yet
Web U1
79 pages
HTML Notes
PDF
No ratings yet
HTML Notes
29 pages
Introdution To HTML
PDF
No ratings yet
Introdution To HTML
51 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
PDF
No ratings yet
Introdution To HTML
69 pages
Introdution to HTML Week2
PDF
No ratings yet
Introdution to HTML Week2
58 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
Introduction To Web Technology: Unit 3 HTML
PDF
No ratings yet
Introduction To Web Technology: Unit 3 HTML
49 pages
Introdution to HTML
PDF
No ratings yet
Introdution to HTML
45 pages
HTML Begin
PDF
No ratings yet
HTML Begin
13 pages
Lesson 3 HTML
PDF
No ratings yet
Lesson 3 HTML
24 pages
Introdution To HTML
PDF
No ratings yet
Introdution To HTML
45 pages
Lecture 2
PDF
No ratings yet
Lecture 2
42 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
Introdution To HTML
PDF
No ratings yet
Introdution To HTML
36 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
47 pages
Chap 02 - Intro To HTML
PDF
No ratings yet
Chap 02 - Intro To HTML
32 pages
Introduction to HTML
PDF
No ratings yet
Introduction to HTML
5 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_Final_show
PDF
No ratings yet
HTML_Final_show
72 pages
WT HTML
PDF
No ratings yet
WT HTML
84 pages
Chapter 2
PDF
No ratings yet
Chapter 2
93 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
CLASS 7 Working With HTML 1
PDF
No ratings yet
CLASS 7 Working With HTML 1
23 pages
UECS2094_2194_-_Topic_2_-_HTML_-_Jan_2025
PDF
No ratings yet
UECS2094_2194_-_Topic_2_-_HTML_-_Jan_2025
86 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
Web Authoring (HTML)
PDF
No ratings yet
Web Authoring (HTML)
64 pages
Web Designing
PDF
No ratings yet
Web Designing
80 pages
Introdution To HTML
PDF
No ratings yet
Introdution To HTML
45 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
2- HTML1
PDF
No ratings yet
2- HTML1
34 pages
html ppts (1)
PDF
No ratings yet
html ppts (1)
21 pages
Web Programming Chapter Two
PDF
No ratings yet
Web Programming Chapter Two
26 pages
New Final HTML Note
PDF
No ratings yet
New Final HTML Note
23 pages
HTML
PDF
No ratings yet
HTML
53 pages
Hyper Text Markup Language
PDF
No ratings yet
Hyper Text Markup Language
36 pages
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
What Is HTML
PDF
No ratings yet
What Is HTML
20 pages
Introduction To HTML
PDF
No ratings yet
Introduction To HTML
13 pages
HTML and It's Properties
PDF
No ratings yet
HTML and It's Properties
24 pages
HTML 5
PDF
No ratings yet
HTML 5
127 pages
HTML
PDF
No ratings yet
HTML
43 pages
WD File
PDF
No ratings yet
WD File
59 pages
Introduction_To_HTML
PDF
No ratings yet
Introduction_To_HTML
46 pages
HTML Notes Ngp
PDF
No ratings yet
HTML Notes Ngp
17 pages
CH 4
PDF
No ratings yet
CH 4
22 pages
Chapter 2 - Part 1
PDF
No ratings yet
Chapter 2 - Part 1
32 pages
Chapter 10 - HTML
PDF
No ratings yet
Chapter 10 - HTML
98 pages
HTML Dhtml.
PDF
No ratings yet
HTML Dhtml.
18 pages
HTML in 30 Pages
From Everand
HTML in 30 Pages
U.Q. Magnusson
4.5/5 (14)
Red Hat Virtualization-4.4-Installing Red Hat Virtualization As A Self-Hosted Engine Using The Cockpit Web interface-en-US
PDF
No ratings yet
Red Hat Virtualization-4.4-Installing Red Hat Virtualization As A Self-Hosted Engine Using The Cockpit Web interface-en-US
82 pages
BordL2+28Tr-LNG - I.N.F.O
PDF
No ratings yet
BordL2+28Tr-LNG - I.N.F.O
3 pages
Coding
PDF
No ratings yet
Coding
1 page
Note For Final Exam
PDF
No ratings yet
Note For Final Exam
47 pages
Adobe Photoshop - Creating Data-Driven Graphics
PDF
No ratings yet
Adobe Photoshop - Creating Data-Driven Graphics
1 page
Install Android Lollipop On At&T Galaxy S4 Active I537, Root & Enable Wifi Tethering
PDF
No ratings yet
Install Android Lollipop On At&T Galaxy S4 Active I537, Root & Enable Wifi Tethering
9 pages
The Hardware Pinout Book PDF
PDF
No ratings yet
The Hardware Pinout Book PDF
1,063 pages
Windows Vista Quick Start Guide
PDF
100% (8)
Windows Vista Quick Start Guide
28 pages
A Short Introduction To STATA
PDF
No ratings yet
A Short Introduction To STATA
8 pages
Registrar Approval Instrument Validation Letters
PDF
No ratings yet
Registrar Approval Instrument Validation Letters
8 pages
5th Sem CN Lab Manual 2021-22
PDF
100% (1)
5th Sem CN Lab Manual 2021-22
69 pages
prisma_introspeccion
PDF
No ratings yet
prisma_introspeccion
9 pages
Coding Python Servel
PDF
No ratings yet
Coding Python Servel
5 pages
Excel Shortcut and Function Keys Microsoft Office Excel 2003
PDF
No ratings yet
Excel Shortcut and Function Keys Microsoft Office Excel 2003
5 pages
Instruction Summary: Realview Assembler User'S Guide
PDF
No ratings yet
Instruction Summary: Realview Assembler User'S Guide
9 pages
BMD 300 Product Brief
PDF
No ratings yet
BMD 300 Product Brief
2 pages
FDFF
PDF
No ratings yet
FDFF
3 pages
Distributed and Object Database Sheet: Processing Logic
PDF
No ratings yet
Distributed and Object Database Sheet: Processing Logic
9 pages
AN0060: Bootloader With AES Encryption
PDF
No ratings yet
AN0060: Bootloader With AES Encryption
16 pages
IP9g QRGv4
PDF
No ratings yet
IP9g QRGv4
2 pages
Type-Erasure-The-Implementation-Details-Klaus-Iglberger-CppCon-2022
PDF
No ratings yet
Type-Erasure-The-Implementation-Details-Klaus-Iglberger-CppCon-2022
88 pages
Uniwill M50ea0 Rev B SCH
PDF
No ratings yet
Uniwill M50ea0 Rev B SCH
31 pages
GIS Question Bank - SRM Valliammai PDF
PDF
No ratings yet
GIS Question Bank - SRM Valliammai PDF
12 pages
TPS reset failed with one or more of these errors 2267512, 2267520 and 2267521 due to RF switch board (RFSB). - GE HealthCare iResolve MR
PDF
No ratings yet
TPS reset failed with one or more of these errors 2267512, 2267520 and 2267521 due to RF switch board (RFSB). - GE HealthCare iResolve MR
4 pages
PPS SOLVED Previous Years Questions PDF
PDF
No ratings yet
PPS SOLVED Previous Years Questions PDF
19 pages
P1415 ISBSGR12DataAnalytics Sarayreh
PDF
No ratings yet
P1415 ISBSGR12DataAnalytics Sarayreh
15 pages
New License - 12861 - 14FEB5EBE9AA - 9 - 24 - 2021
PDF
No ratings yet
New License - 12861 - 14FEB5EBE9AA - 9 - 24 - 2021
6 pages
Explore IP Configuration
PDF
No ratings yet
Explore IP Configuration
3 pages
Teamassist: CST 499 Computer Science Capstone
PDF
No ratings yet
Teamassist: CST 499 Computer Science Capstone
22 pages
Documents
Computers
Internet & Web