Chapter-II(Introduction of HTML)
Chapter-II(Introduction of HTML)
Introduction of HTML
HTML Tag :
Output:
i. Container Tags
Those html tags which have both opening and closing tags called container
tags.
Opening tag
Closing Description
tag tag
The tags which requires only opening not closing tag in an html document is
called Empty tags or Non-container tags.
iii. Attribute
Output:
c) Background Sound
In html Background sound is set by following tags
HTML defines six levels of headings. A heading element implies all the font changes,
paragraph breaks before and after, and any white space necessary to render the heading.
The heading elements are H1, H2, H3, H4, H5, and H6 with H1 being the highest (or most
important) level and H6 the least.
Example:
<head>
<title>
HTML Alignment
</title>
</head>
<body>
<h1 align ="center"> Nepal Polytechnic Institute</h1>
<h2 align ="left"> Bharatpur </h2>
<h2 align ="Center"> Chitwan </h2>
<h2 align ="right"> Nepal </h2>
</body>
</html>
i. Size: 1to 7
To maintain the size of font in html we can use <font size=” “> </font>
Tags
Examples:
Output:
To manage the font style, color and size we can use following tags
<! DOCTYPE html>
<html>
<head>
<title>Basefont Demo</title>
<basefont color="black" size="5" face="arial">
</head>
<body>
<p>Example of Basefont tag</p>
</body>
</html>
The <small> HTML element represents side-comments and small print, like
copyright and legal text, independent of its styled presentation. By default,
it renders text within it one font-size smaller, such as from small to x-small.
While The HTML <big> tag makes text one font size bigger in the HTML
document. This tag is also commonly referred to as the <big> element.
Examples:
The HTML <p> element defines a paragraph. A paragraph always starts on a new line, and
browsers automatically add some white space (a margin) before and after a paragraph.
The browser does not recognize new line and paragraph formatting in the text. If you want
to start a new line, you need to insert a line break with the help of of the <br>. The
<br> tag insert a single carriage return or break in the document. This element has no
end tag.
Examples:
HTML comments are not displayed in the browser, but they can help document your
HTML source code. An HTML comment begins with <! - - and the comment closes with
- - >.
Examples:
<html>
<head>
</head>
<body>
<p>
</P>
</body>
</html>
The <blockquote> HTML element indicates that the enclosed text is an extended
quotation. Usually, this is rendered visually by indentation (see Notes for how to
change it).
Examples:
<! DOCTYPE HTML>
<html>
<head>
<title> Block quote Demo </title>
</head>
<body>
<figure>
<p>
If I have seen further than others, it is by standing upon the shoulders of giants.
</p>
<figcaption> -----Sir Isaac newton </figcaption>
</figure>
</body>
</html>
Output:
Examples:
The HTML <strike> tag gives text the appearance of a strikethrough which
draws a horizontal line over the text. This tag is also commonly referred to as
the <strike> element.
<! DOCTYPE HTML>
<html>
<head>
<title> Strike Demo </title>
</head>
<body>
<p> <strike> Water </strike>
Water is neither acid nor base </p>
</body>
</html>
Output:
The <sup> tag defines superscript text. While <sub> tag defines subscript text.
Examples:
For different types of ordered list <ol type = “ “> can be used.
The start attribute specifies the start value of the first list item in an ordered list
and used in <ol > tag. This value is always an integer, even when the numbering
type is letters or romans. The value attribute sets the value of a list item. The
following list items will increment from that number and is used in <li> tag.
<! DOCTYPE HTML>
<html>
<head>
<title> OL Demo </title>
</head>
<body>
<ol start="50" >
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<ol >
<li value ="100" >Coffee</li>
<li>Tea</li>
<li>Milk</li>
<li>Water</li>
</ol>
</body>
</html>
Examples:
<! DOCTYPE HTML>
<html>
<head>
<title> UL Demo </title>
</head>
<body>
<ul>
<li>Nepal</li>
<li>Bhutan</li>
<li>Bangladesh</li>
</ul>
</body>
</html>
Output:
<ul type =” “> tag is defining bullet in disc, circle and square in html.
The <dl> HTML element represents a description list. The element encloses a list
of groups of terms (specified using the <dt> element) and descriptions
(provided by <dd> elements).
Examples:
Output:
The HTML <marquee> tag is used for scrolling piece of text or image displayed either
horizontally across or vertically down your web site page depending on the settings.
Examples:
Output:
An anchor is a piece of text which marks the beginning and/or the end of a hypertext link.
The text between the opening tag and the closing tag is either the start or destination (or
both) of a link.
I. Creating link:
Links are found in nearly all web pages. Links allow users to click
their way from page to page. The HTML <a> tag defines a hyperlink.
The most important attribute of the <a> element is the href attribute,
which indicates the link's destination.
Examples:
Examples:
Examples:
V. Horizontal Rules:
<hr> tag is used to draw horizontal line in html and noshade is used to draw solid
horizontal line.
Examples: