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)
23 views
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 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)
23 views
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 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
Web Development Report Industrial Training
PDF
No ratings yet
Web Development Report Industrial Training
57 pages
MarkDown Bible
PDF
No ratings yet
MarkDown Bible
7 pages
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)
Odoo Development
PDF
No ratings yet
Odoo Development
155 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)
Harshavardhan T UI Developer - Angular Phone Number: +91-9052752852
PDF
No ratings yet
Harshavardhan T UI Developer - Angular Phone Number: +91-9052752852
4 pages
Public Distribution System
PDF
No ratings yet
Public Distribution System
47 pages
VFP9 Report Overview
PDF
No ratings yet
VFP9 Report Overview
28 pages
CRC Quick Javascript
PDF
No ratings yet
CRC Quick Javascript
167 pages
Steel
PDF
No ratings yet
Steel
52 pages
New Web Designing Course Syllabus
PDF
No ratings yet
New Web Designing Course Syllabus
2 pages
Iran3x Takehost
PDF
100% (5)
Iran3x Takehost
9 pages
Java Applets & Graphics Programming
PDF
No ratings yet
Java Applets & Graphics Programming
19 pages
JavaScript - Quick Guide
PDF
No ratings yet
JavaScript - Quick Guide
119 pages
Creating Simple ASP Pages: Adding Server-Side Script Commands
PDF
No ratings yet
Creating Simple ASP Pages: Adding Server-Side Script Commands
11 pages
HTML Tags
PDF
No ratings yet
HTML Tags
26 pages
New Perspectives on Computer Concepts 2016 Comprehensive Standalone book 18th Edition Parsons - Download the ebook today to explore every detail
PDF
100% (3)
New Perspectives on Computer Concepts 2016 Comprehensive Standalone book 18th Edition Parsons - Download the ebook today to explore every detail
56 pages
GK Computer (English)
PDF
No ratings yet
GK Computer (English)
8 pages
HTML CSS Report
PDF
No ratings yet
HTML CSS Report
44 pages
Download full Fluency with Information Technology 7 e Lawrence Snyder & Ray Henry ebook all chapters
PDF
100% (2)
Download full Fluency with Information Technology 7 e Lawrence Snyder & Ray Henry ebook all chapters
55 pages
Styling Texts 1
PDF
No ratings yet
Styling Texts 1
6 pages
Infile Statement
PDF
No ratings yet
Infile Statement
20 pages
Exercise
PDF
100% (1)
Exercise
2 pages
GanttProject Handbook
PDF
No ratings yet
GanttProject Handbook
24 pages
iMMS: Interactive Multimedia Messaging Service: J. Shen P. Sun J. Zhang S. Song
PDF
No ratings yet
iMMS: Interactive Multimedia Messaging Service: J. Shen P. Sun J. Zhang S. Song
7 pages
XHTML by - Example
PDF
No ratings yet
XHTML by - Example
381 pages
HTML Seminar PPT and PDF Report
PDF
No ratings yet
HTML Seminar PPT and PDF Report
2 pages
Sastri - 4-Sem - 2017
PDF
No ratings yet
Sastri - 4-Sem - 2017
45 pages
WT Lab Manualpdf
PDF
No ratings yet
WT Lab Manualpdf
85 pages
Ict Reviewer
PDF
No ratings yet
Ict Reviewer
2 pages
Creating HTML Form Using Kompozer: Previous Years' Board Paper - Question Bank
PDF
No ratings yet
Creating HTML Form Using Kompozer: Previous Years' Board Paper - Question Bank
14 pages
CV Vaishali 1
PDF
No ratings yet
CV Vaishali 1
5 pages
Documents
Computers
Internet & Web