You are on page 1of 8

Lecture 01

Chapter 8 (Introduction to HTML)

Introduction to HTML:

HTML is an acronym which stands for Hyper Text Markup Language


which is used for creating web pages and web applications. HTML
describes the structure of a Web page. HTML consists of a series of
elements.

Key Points:

 HyperText simply means “Text within Text.” A text has a link


within it, is a hypertext.
 The word markup refers to the symbols that are used to define
structure of the text.
 The word Language refers to the syntax that is similar to any other
language.

1|Page
Lecture 01

HTML Tags:

HTML tags can be considered as hidden keywords or commands


incorporated in HTML which holds the capability to define how the
browser will display the content and format of the web page. Tags are
indicated with pair of angle brackets. They start with a less than (<)
character and end with a greater than (>) character. There are two types
of tags.

Container tags: These types of tags having both opening and


closing tags are called container tags. e.g. <p>…</p>, <b>…</b>
etc.

Empty tags:

Those who only have an opening tag and no closing tag are called
empty tags. e.g. <br>, <hr>, <img>, <link>, <meta>, <base> etc.
It is also called Void Element element.

Basic html code for creating a web page/HTML Page Structure:

There are two sections. One is head section and another is body section.

2|Page
Lecture 01

Head Section:

The HEAD tag is an important tag used to add the header in HTML. It
is used to give various additional information about the page along
with description and title to your page.

Body section:

The BODY tag is used to give the body, i.e., the visible section of the
HTML document. All formatting and writing of content are done in
the opening <body> and the closing </body> tag.

Practice Code:

<HTML>
<HEAD>
<Title>
My First Webpage
</Title>
</HEAD>
<Body>
HTML First Class
</Body>
</HTML>

3|Page
Lecture 01

HTML Paragraph

HTML paragraph or HTML <p> tag is used to define a paragraph in a


webpage. It is a block-level element and always starts on a new line.
Before and after each paragraph, browsers add margin automatically.

Practice Code:

<html>
<head>
<title>Title of the document</title>
</head>
<body>
<p>This is a paragraph</p>
</body>
</html>

What does <nobr> HTML Tag do?

The HTML <nobr> tag is used to instruct the browser not to break the
specified text (such as the usual line wrap that occurs at the right edge
of the browser window).

4|Page
Lecture 01

Practice Code:

<html>

<head>
<title>HTML nobr Tag</title>
</head>

<body>
<nobr>This is a very long sequence of text that is forced to be
on a single line, even if doing so causes <wbr />

the browser to extend the document window beyond the size of


the
viewing pane and the poor user must scroll right <wbr />

to read the entire line.


</nobr>
</body>

</html>

5|Page
Lecture 01

HTML Text Formatting

Text formatting helps us improve the visual appeal of the text in any
document. HTML provides many tags to format the appearance of the
text on the web page and make it look attractive to the site visitors.
Such as Bold, Italic and Underline.

HTML Bold Tag

The HTML <b> tag specifies bold text, without any logical
importance. It opens with <b> and ends with </b> tag.

Practice Code:

<html>

<head>

<title>Bold Text Example</title>

</head>

<body>

<p>This is normal text.</p>

<p><b>This is bold text.</b></p>

</body>

</html>

6|Page
Lecture 01

HTML Italic Tag

The HTML <i> tag displays the text in italics. It begins with <i> tag
and ends with </i> tag.

Practice Code:

<html>

<head>

<title>Italic Text Example</title>

</head>

<body>

<p>This is normal text.</p>

<p><i>This is italic text.</i></p>

</body>

</html>

7|Page
Lecture 01

HTML Underline Tag

The <u> tag in HTML stands for underline, and it’s used to underline
the text enclosed within the <u> tag.

Practice Code:

<html>

<head>

<title> Underlined Text Example</title>

</head>

<body>

<p>This is normal text.</p>

<p><u>This is underlined text.</u></p>

</body>

</html>

8|Page

You might also like