You are on page 1of 115

UNIT - 1

INTRODUCTION
TO HTML
1. HTML - Introduction
2. HTML - Basic tags

S.No Reg No Content prepared by


1 19UIT001 Aishwarya K

3. HTML - Meta Tags


4. HTML - Attributes

S.No Reg No Content prepared by


2 19UIT003 Akshaya R

5. HTML - Formatting
6. HTML - Phrase Tags

S.No Reg No Content prepared by


3 19UIT004 Amrithaa M

7. HTML - Comments
8. HTML - Fonts

S.No Reg No Content prepared by


4 19UIT005 Anjana M

9. HTML - Marquees
10. HTML - Images

S.No Reg No Content prepared by


5 19UIT006 Aparna P M

11. HTML - Text Links


12. HTML - Image Links

S.No Reg No Content prepared by


6 19UIT008 Bhargavi B

13. HTML - Email Links


14. HTML - Tables

S.No Reg No Content prepared by


7 19UIT009 Bhuvaneshwari R
15. HTML - Frames

S.No Reg No Content prepared by


8 19UIT012 Haridharani G

16. HTML - Lists

S.No Reg No Content prepared by


9 19UIT010 Deepika N

17. HTML - Layouts


18. HTML - Colors

S.No Reg No Content prepared by


10 19UIT011 Deepika S

19. HTML - Forms


20. HTML - Backgrounds

S.No Reg No Content prepared by


11 19UIT013 Harshini M

21. HTML - Embed Multimedia


22. HTML - Styles

S.No Reg No Content prepared by


12 19UIT007 Arulselvi M
1. HTML - INTRODUCTION

 HTML stands for Hyper Text Markup Language.


 HTML is the standard markup language for creating Web pages.
 HTML describes the structure of a Web page.
 HTML consists of a series of elements.

Example:

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>

HTML HISTORY

Since the early days of the World Wide Web, there have been many versions of HTML:

YEAR VERSION

1989 Tim Berners-Lee invented www

1991 Tim Berners-Lee invented HTML

1993 Dave Raggett drafted HTML+

1995 HTML Working Group defined HTML 2.0

1997 W3C Recommendation: HTML 3.2

1999 W3C Recommendation: HTML 4.01

2000 W3C Recommendation: XHTML 1.0

2008 WHATWG HTML5 First Public Draft

2012 WHATWG HTML5 Living Standard

2014 W3C Recommendation: HTML5

2016 W3C Candidate Recommendation: HTML 5.1

2017 W3C Recommendation: HTML5.1 2nd Edition

2017 W3C Recommendation: HTML5.2


2. HTML - BASIC TAGS

OPEN TAG CLOSE TAG DESCRIPTION


<p> </p> This tag allows you to create paragraphs

HEADING 1

<h1> </h1> This is the largest heading

HEADING 2

<h2> </h2> This is second biggest heading

HEADING 3

<h3> </h3> This is the next heading

HEADING 4

<h4> </h4> This is another heading

HEADING 5

<h5> </h5> This is the second smallest heading

HEADING 6

<h6> </h6> This is the smallest heading

<hr > n/a This is a horizontal line. You can use width
and size attributes

<b> </b> This makes text bold

<i> </i> This makes text italic

<br /> n/a This tag allows you to insert line breaks

MULTIPLE CHOICE QUESTIONS

1) HTML stands for –


A) HighText Machine Language
B) HyperText and links Markup Language
C) HyperText Markup Language
D) None of these

2) Which of the following element is responsible for making the text bold in HTML?
A) <pre>
B) <a>
C) <b>
D) <br>

3) Which of the following tag is used for inserting the largest heading in HTML?
A) <h3>
B) <h1>
C) <h5>
D) <h6>
4) Which of the following tag is used to insert a line-break in HTML?
A) <br>
B) <a>
C) <pre>
D) <b>

5) Which character is used to represent the closing of a tag in HTML?


A) \
B) !
C) /
D) .

6) How to create an ordered list in HTML?


A) <ul>
B) <ol>
C) <li>
D) <i>

7) How to create an unordered list in HTML?


A) <ul>
B) <ol>
C) <li>
D) <i>

8) How to insert an image in HTML?


A) <img href = “jtp.png” />
B) <img url = “jtp.png” />
C) <img link = “jtp.png” />
D) <img src = “jtp.png” />
3. HTML - META TAGS

HTML lets you specify metadata - additional important information about a document in a variety of ways. The META
elements can be used to include name/value pairs describing properties of the HTML document, such as author, expiry date, a list
of keywords, document author etc.

The <meta> tag is used to provide such additional information. This tag is an empty element and so does not have a closing
tag but it carries information within its attributes.
A web document can include one or more meta tags depending on information, but in general, it doesn’t affect the physical
appearance of the document.
SYNTAX

<meta attribute-name="value">

ADDING META TAGS TO DOCUMENTS

You can add metadata to your web pages by placing <meta> tags inside the header of the document which is represented
by <head> and </head> tags. A meta tag can have following attributes in addition to core attributes.

S.NO ATTRIBUTES DESCRIPTION

1 Name Name for the property. Can be anything. Examples


include, keywords, description, author, revised,
generator etc.
2 Content Specifies the property's value.

3 scheme Specifies a scheme to interpret the property's value


(as declared in the content attribute).
4 http-equiv Used for http response message headers. For
example, http-equiv can be used to refresh the page
or to set a cookie. Values include content-type,
expires, refresh and set-cookie.

SPECIFYNING KEYWORDS

You can use <meta> tag to specify important keywords related to the document and later these keywords are used by the
search engines while indexing your webpage for searching purpose.

Example:

<html>

<head>

<tiltle>Example</title>

<h1>SPECIFYING KEY WORDS</h1>

<meta name = "example" content = "eample for meta tags" />

</head>

<body>

<p>META TAGS EXAMPLE</p>

</body>

</html>
Output:

SPECIFYING KEY WORDS

META TAGS EXAMPLE

DOCUMENT DESCRIPTION

You can use <meta> tag to give a short description about the document. This again can be used by various search engines
while indexing your webpage for searching purpose.

Example:

<html>

<head>

<h>DOCUMENT DESCRIPTION</h>

<meta name = "keywords" content = "search engine" />

<meta name = "description" content = "learn about document description ." />

</head>

<body>

<p> various search engines while indexing your webpage for searching purpose.</p>

</body>

</html>

Output:
DOCUMENT DESCRIPTION
various search engines while indexing your webpage for searching purpose.

DOCUMENT REVISION DATE

You can use <meta> tag to give information about when last time the document was updated. This information can be used
by various web browsers while refreshing your webpage.

Example:

<html>

<head>

<h>Document Revision Date</h>

<meta name = "keywords" content = "html ,Meta Tags, Revision Date" />

<meta name = "description" content = "Learning about Document Revision Date." />

<meta name = "revised" content = "revision date, 25/08/2021" />

</head>

<body>

<p>This information can be used by various web browsers while refreshing your webpage.</p>

</body>
</html>

Output:

Document Revision Date


This information can be used by various web browsers while refreshing your webpage.

DOCUMENT REFRESHING

A <meta> tag can be used to specify a duration after which your web page will keep refreshing automatically.

Example:

<html>

<head>

<h>Document Refreshing</h>

<meta name = "keywords" content = "html, Meta Tags, Refreshing" />

<meta name = "description" content = "Learning about Document Refreshing" />

<meta name = "revised" content = "revishion , 25/08/2021" />

<meta http-equiv = "refresh" content = "15" />

</head>

<body>

<p>web page will keep refreshing automatically.</p>

</body>

</html>

Output:
Document Refreshing
web page will keep refreshing automatically

PAGE REDIRECTION

You can use <meta> tag to redirect your page to any other webpage. You can also specify a duration if you want to redirect
the page after a certain number of seconds.

Example:

<html>

<head>

<title> Example</title>

<h>Page Redirection</h>

<meta name = "keywords" content = "html, Meta Tags, Redirection" />

<meta name = "description" content = "Learning about Meta Tags." />

<meta name = "revised" content = "revision , 25/08/2021" />

<meta http-equiv = "refresh" content = "15; url = http://www.revisionhtml.com" />

</head>

<body>
<p>redirect the page after a certain number of seconds.</p>

</body>

</html>

Output:
Page Redirection
redirect the page after a certain number of seconds.

SETTING COOKIES

Cookies are data, stored in small text files on your computer and it is exchanged between web browser and web server to
keep track of various information based on your web application need.

You can use <meta> tag to store cookies on client side and later this information can be used by the Web Server to track a
site visitor.

Example:

<html>

<head>

<title>example </title>

<h>SETTING COOKIES</h>

<meta http-equiv = "cookie" content = "userid = abc79; expires = Wednesday, 25-Aug-2021 13:12:59 GMT;" />

</head>

<body>

<p>Information can be used by the Web Server to track a site visitor.</p>

</body>

</html>

Output:
SETTING COOKIES
Information can be used by the Web Server to track a site visitor.

SETTING AUTHOR NAME

You can set an author name in a web page using meta tag.

Example:
<html>

<head>
<title>Example</title>
<h> Setting Author Name</h>
<meta name = "keywords" content = "html, Meta Tags, author" />
<meta name = "description" content = "Learning about Meta Tags author name." />
<meta name = "author" content = "Mahnaz Mohtashim" />
</head>
<body>
<p>set an author name in a web page</p>
</body>

</html>
Output:

Setting Author Name


set an author name in a web page

SPECIFY CHARACTER SET

You can use <meta> tag to specify character set used within the webpage.

Example:

<html>

<head>

<title> Example</title>

<h>Specify Character Set</h>

<meta name = "keywords" content = "HTML, Meta Tags, Specify Character Set" />

<meta name = "description" content = "Learning about Meta Tags." />

<meta name = "author" content = "Mahnaz Mohtashim" />

<meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8" />

</head>

</html>
Output:

Specify Character Set


4. HTML - ATTRIBUTES

An attribute is used to define the characteristics of an HTML element and is placed inside the element's opening tag. All
attributes are made up of two parts − a name and a value

 The name is the property you want to set. For example, the paragraph <p> element in the example carries an attribute whose
name is align, which you can use to indicate the alignment of paragraph on the page.

 The value is what you want the value of the property to be set and always put within quotations. The below example shows
three possible values of align attribute: left, center and right.

Attribute names and attribute values are case-insensitive. However, the World Wide Web Consortium (W3C) recommends
lowercase attributes/attribute values in their HTML 4 recommendation.

Example:

<html>

<head>

<title>Align Attribute Example</title>

<h>ALIGNMENT</h>

</head>

<body>

<p align = "left">left aligned</p>

<p align = "center">center aligned</p>

<p align = "right"> right aligned</p>

</body>

</html>

Output:

ALIGNMENT
left aligned
center aligned
right aligned

CORE ATTRIBUTES

The four core attributes that can be used on the majority of HTML elements (although not all) are −

1. Id
2. Title
3. Class
4. Style

1. THE id ATTRIBUTE

The id attribute of an HTML tag can be used to uniquely identify any element within an HTML page. There are two primary
reasons that you might want to use an id attribute on an element −

 If an element carries an id attribute as a unique identifier, it is possible to identify just that element and its content.
 If you have two elements of the same name within a Web page (or style sheet), you can use the id attribute to distinguish
between elements that have the same name.

Example:

<p id =” unique identifier" >it is possible to identify just that element and its content.
</p>
<p id = ”web page"> id attribute to distinguish between elements that have the same name.
</p>

2. THE title ATTRIBUTE

The title attribute gives a suggested title for the element. They syntax for the title attribute is similar as explained
for id attribute −

The behavior of this attribute will depend upon the element that carries it, although it is often displayed as a tooltip when
cursor comes over the element or while the element is loading.

Example:
<html>
<head>
<title>The title Attribute Example</title>
</head>

<body>
<h1 title = "Title Attribute"> The title attribute gives a suggested title for the element </h1>
</body>

</html>

Output:

The title attribute gives a suggested title for the element

3. THE class ATTRIBUTE

The class attribute is used to associate an element with a style sheet, and specifies the class of element. You will learn more
about the use of the class attribute when you will learn Cascading Style Sheet (CSS). So for now you can avoid it.

The value of the attribute may also be a space-separated list of class names.

Example:
class = "Cascading style sheet"

4. THE style ATTRIBUTE

The style attribute allows you to specify Cascading Style Sheet (CSS) rules within the element.

Example:
<html>

<head>
<title>The style Attribute</title>
</head>

<body>
<p style = "font-family:arial; color:#FF0000;">The style Attribute.</p>
</body>

</html>
Output:

The style Attribute

INTERNATIONALIZATION ATTRIBUTES

There are three internationalization attributes, which are available for most (although not all) XHTML elements.

1. dir
2. lang
3. xml:lang

1. THE dir ATTRIBUTE

The dir attribute allows you to indicate to the browser about the direction in which the text should flow. The dir attribute
can take one of two values,

VALUE DEFINITION

Ltr Left to right (the default value)


Rtl Right to left (for languages such as Hebrew or
Arabic that are read right to left)

Example:

<html dir = "rtl">

<head>
<title>Display Directions</title>
</head>

<body>
When used within another tag, it controls the text's direction for just the content of that tag. right-to-left directed text.
</body>

</html>

Output:

When used within another tag, it controls the text's direction for just the
content of that tag. right-to-left directed text.

2. THE lang ATTRIBUTE

The lang attribute allows you to indicate the main language used in a document, but this attribute was kept in HTML only
for backwards compatibility with earlier versions of HTML. This attribute has been replaced by the xml:lang attribute in new
XHTML documents.

The values of the lang attribute are ISO-639 standard two-character language codes.

Example:

<html lang = "en">

<head>
<title>English Language Page</title>
</head>
<body>
The lang attribute
</body>

Output:

The lang attribute

3. THE xml:lang ATTRIBUTE

The xml:lang attribute is the XHTML replacement for the lang attribute. The value of the xml:lang attribute should be an
ISO-639 country code as mentioned in previous section.

Generic Attributes:

ATTRIBUTE OPTION FUNCTION

Align right, left, center Horizontally aligns tags

Valign top, middle, bottom Vertically aligns tags within an HTML element

Bgclor numeric, hexidecimal, Places a background color behind an element


RGB values

Background URL Places a background image behind an element

Id User Defined Names an element for use with Cascading Style Sheets.

Class User Defined Classifies an element for use with Cascading Style
Sheets.
Width Numeric Value Specifies the height of tables, images, or table cells.

Hight Numeric Value Specifies the height of tables, images, or table cells.

Title User Defined "Pop-up" title of the elements

MULTIPLE CHOICE QUESTIONS

1. …………….. is used to provide additional information.

a)<meta>tag
b)<title>tag
c)<html>tag
d)<head> tag

2. Which <meta>tag is used to give short description about the document?

a)document description
b)document revision date
c)document refreshing
d)page redirection

3. Which tag is give information about when last time the document was uploaded?

a)setting author name


b)document refreshing
c)cookies
d) document revision date
4. Page redirection used for?

a)redirect one page to another web page


b)refreshing the web page
c)set the author name
d)description

5. <meta> tags to store………on clients side and later this information can be used b the web server to track a site visitor.

a)author name
b)character set
c)cookie
d)redirection

6. How many elements in core Attribute?

a)7
b)6
c)9
d)4

7. Which attributes is used to uniquely identify any element within an html page?

a)class
b)id
c)style
d)title

8. How many attributes are in internationalization attribute?

a)3
b)9
c)2
d)5

9. Which attribute used to place a back ground color behind an element?

a)background color
b)valign
c)bgcolor
d)id

10. Which attribute is used to classifies an element for use with cascading style sheets?

a)clss
b)id
c)title
d)width

6 MARK QUESTION

1. What is attribute?explain the types ofattribute

12 MARK QUESTION

1. Explain briefly about <meta>tag with example. How <meta> tags are used in html?
5. HTML - FORMATTING

BOLD TEXT

The text that appears within <b>...</b>element,is displayed in bold.

Example:

<html>

<head>

<title>Example for bold text</title>

</head>

<body>

<p>She is from <b> London</b>.</p>

</body>

</html>

Output:

She is from London.

ITALIC TEXT

The text that appears within <i>..</i>element,is displayed in italicized.

Example:

<html>

<head>

<title>Example for italic text</title>

</head>

<body>

<p>She is from <i> London</i>.</p>

</body>

</html>

Output:

She is from London.

UNDERLINED TEXT

The text that appears within <u>...</u>element,is displayed in underline.

Example:

<html>

<head>

<title>Example for bold text</title>

</head>

<body>

<p>She is from <u> London</u>.</p>

</body>
</html>

Output:

She is from London.

STRIKE TEXT

The text that appears within <strike>...</strike>element,is displayed with strikethrough,which is a thin line through
the text.

Example:

<html>

<head>

<title>Example for strike text</title>

</head>

<body>

<p>She is from <strike> London</strike>.</p>

</body>

</html>

Output:

She is from London.

MONOSPACED FONT

The content of a <tt>...</tt> element is written in monospaced font.The fonts are known as variable-width fonts because
different letters are of different widths.In a monospaced font,each letter has the same width.

Example:

<html>

<head>

<title>Example for monospaced font</title>

</head>

<body>

<p>She is from <tt> London</tt>.</p>

</body>

</html>

Output:

SUPERSCRIPT TEXT

The content of a <sup>...</sup> element is written in superscript.The font size used is the same size as the character's
height above the other characters.

Example:

<html>

<head>

<title>Example for superscript text</title>


</head>

<body>

<p>She is from <sup> London</sup>.</p>

</body>

</html>

Output:

She is from London.

SUBSCRIPT TEXT

The content of a <sub>...</sub> element is written in subscript.The font size used is the same as the character surrounding
it,but display the half of the character.

Example:

<html>

<head>

<title>Example for subscript text</title>

</head>

<body>

<p>She is from <sub> London</sub>.</p>

</body>

</html>

Output:

She is from London.

INSERTED TEXT

The text that appear within <ins>...</ins> element is displayed as inserted text.

Example:

<html>

<head>

<title>Example for inserted text</title>

</head>

<body>

<p>She is from <del> London</del> <ins>America</ins>.</p>

</body>

</html>

Output:

She is from London America.

DELETED TEXT

The text that appear within<del>...</del> element will be deleted.

Example:

<html>

<head>
<title>Example for deleted text</title>

</head>

<body>

<p>She is from <ins> London</ins> <del>America</del>.</p>

</body>

</html>

Output:

She is from America London.

LARGER TEXT

The text <big>...</big> element is displayed one font size larger than the rest of the text.

Example:

<html>

<head>

<title>Example for larger text</title>

</head>

<body>

<p>She is from <big> London</big>.</p>

</body>

</html>

Output:

She is from London.

SMALLER TEXT

The text of the <small>....</small> element is displayed one font size smaller than the rest of the text.

Example:

<html>

<head>

<title>Example for smaller text</title>

</head>

<body>

<p>She is from <small> London</small>.</p>

</body>

</html>

Output:

She is from London.

GROUPING CONTENT

The <div> and <span> elements allow to group together several elements to create sections or subsections of a page.

Example:

<html>

<head>
<title>Example for div tag</title>

<style>

div{

color:red;

background color:white;

text align:center;

</style>

</head>

<body>

<h2>Beautiful quotes</h2>

<div>A Lord shall bless thee out of zion</div>

</body>

</html>

Output:

Example:

<html>

<head>

<title>Example for span tag</title>

</head>

<body>

<h2>Definition of birthday</h2>

<p><span style="color:blue">The one day</span>in your

life Your Mother smiled</span><span style="color:violet">

when you cried</span></p>

</body>

</html>

Output:
6. HTML - PHRASE TAGS

EMPHASIZED TEXT

The text that appears within <em>...</em> elements is displayed as emphasized text.

Example:

<html>

<head>

<title>Example for emphasized text</title>

</head>

<body>

<p>She is from <em> London</em>.</p>

</body>

</html>

Output:

MARKED TEXT

The text that appears within <mark>...</mark> element,is displayed as marked in yellow ink.

Example:

<html>

<head>

<title>Example for marked text</title>

</head>

<body>

<p>She is from <mark> London</mark>.</p>

</body>

</html>

Output:

STRONG TEXT

The text that appears within <strong>...</strong> element is displayed as important text.

Example:

<html>

<head>

<title>Example for strong text</title>

</head>
<body>

<p>She is from <strong> London</strong>.</p>

</body>

</html>

Output:

TEXT ABBREVIATION

The text by putting it inside <abbr>....</abbr> .The title attribute must contain this full description and nothing else.

Example:

<html>

<head>

<title>Example for text abbreviation</title>

</head>

<body>

<p>This is <abbr title="Hyper Text Maerkup

Language">HTML</abbr>.</p>

</body>

</html>

Output:

ACRONYM ELEMENT

The <acronym> element allows to indicate the text between <acronym>...</acronym>.

Example:

<html>

<head>

<title>Example for acronym element</title>

</head>

<body>

<p><acronym title="World Health Organisation">

WHO</acronym></p>

</body>

</html>

Output:
TEXT DIRECTION

The <bdo>...</bdo> element stands for Bi-Directional override and it is used to override the current text direction.

Example:

<html>

<head>

<title>Example for text direction</title>

</head>

<body>

<p style="direction:itr;">These are vegetables.</p>

<p><bdo dir="rtl">These are fruits.</bdo></p>

</body>

</html>

Output:

SPECIAL TERMS

The <dfn>...</dfn> element allows to specify a special term.Its usage is similar to italic words in the midst of a paragraph.

Example:

<html>

<head>

<title>Example for special terms</title>

</head>

<body>

<p>She is from <dfn> London</dfn>.</p>

</body>

</html>

Output:

QUOTING TEXT

When we want to quote a passagefrom another source,that should be quoted between <blockquote>...</blockquote>.

Example:

<html>

<head>

<title>Example for blockquotes text</title>

</head>

<body>
<p>The following description of HTML </p>

<blockquotes>HTML is Hyper Text Markup Language.

</blockquotes>

</body>

</html>

Output:

SHORT QUOTATIONS

The <q>...</q> element is used when we want to add a double quote within a sentences.

Example:

<html>

<head>

<title>Example for short quotations</title>

</head>

<body>

<p>She is from London,<q>no ,she is wrong</q>.</p>

</body>

</html>

Output:

TEXT CITATIONS

If we quotes a text,that can indicate the source placing it between an opening <cite>....</cite>.

Example:

<html>

<head>

<title>Example for text citations</title>

</head>

<body>

<p>Class c is derived from <cite> class a and b </cite>.</p>

</body>

</html>

Output:
COMPUTER CODE

Any programming code to appear on a web page should be placed inside <code>...</code>.The content of the <code>
element is presented in a monospaced font.

Example:

<html>

<head>

<title>Example for computer code</title>

</head>

<body>

<p>c,c++,java,python <code> These are code language</code>

</p>

</body>

</html>

Output:

KEYBOARD TEXT

The <kbd>...</kbd> element to indicate what should be typed in.

Example:

<html>

<head>

<title>Example for keyboard text</title>

</head>

<body>

<p>This is a <kbd> Keyboard element</kbd>.</p>

</body>

</html>

Output:

PROGRAMMING VARIABLES

This element is usually used in conjunction with the <pre> and <code> elements to indicate that the content of that
element is variable.

Example:

<html>

<head>

<title>Example for variable text</title>

</head>
<body>

<p><code>password("<var>user-name</var>")</p>

</body>

</html>

Output:

PROGRAM OUTPUT

The <samp>...</samp> element indicates sample output from a program and script etc.Its mainly used when
documenting programming or coding concepts.

Example:

<html>

<head>

<title>Example for program output</title>

</head>

<body>

<p>This is a beautiful<samp> world </samp></p>

</body>

</html>

Output:

ADDRESS TEXT

The <address>....</address> element is used to contain any address.

Example:

<html>

<head>

<title>Example for address text</title>

</head>

<body>

<address>54,thilai nagar,chennai-Tamil nadu.</address>

</body>

</html>

Output:
MULTIPLE CHOICE QUESTIONS

1.Which tag is used to display an element in underline form?

a.<b>...</b>

b.<u>...</u>

c.<i>...</i>

d.<ul>...</ul>

2.By using which tag we can write an element in monospaced font?

a.<b>...</b>

b.<tt>...</tt>

c.<strike>...</strike>

d.<i>...</i>

3.By using superscript text <sup>...</sup> the result will be shown as?

a.half a character's height right to the other character

b.half a character's height below to the other character

c.half a character's height above the other character

d.half a character's height left to the other character

4.Which tag is used to insert an element?

a.<sub>...</sub>

b.<del>...</del>

c.<i>...</i>

d.<ins>...</ins>

5.The element that appears within <strong>...</strong> is displayed as___

a.important text

b.normal text

c.bold text

d.underline text

6.Which tag is used to abbrivate a text?

a.<div>...</div>

b.<abbr>...</abbr>

c.<acronym>...</acronym>

d.<em>...</em>

7.What does <dfn>...</dfn> indicates?

a.it specify to introduce a tag

b.it specify to introduce a attribute

c.it specify to introduce a special term

d.it specify to introduce an element


8.By using which tag we can indicate an element is a variable?

a.<kbd>...</kbd>

b.<pre>...</pre>

c.<code>...</code>

d.both b and c

6 MARK QUESTION

1.Explain about grouping content format and give a example in HTML program.

12 MARK QUESTION

1.Explain phrase tag and give a example in HTML program.


7. HTML - COMMENTS

Comments are some text or code written in your code to give an explanation about the code, and not visible to the user.
Comments which are used for HTML file are known as HTML comments. Anything written between these tags will be ignored by
the browser, so comments will not be visible on the webpage.
Comments of any code make code easy to understand and increase readability of code. Comments are also part of the code,
which gives an explanation of the code.
HTML comments are placed in between <!-- ... --> tags.
Example:
<!DOCTYPE html>
<html>
<head> <!-- Document Header Starts -->
<title>This is document title</title>
</head> <!-- Document Header Ends -->
<body>
<p>Hello HTML.....</p>
</body>
</html>
This will produce the following result without displaying the content given as a part of comments:
Output:

Hello HTML……..

VALID COMMENT AND INVALID COMMENT

Comments do not nest which means a comment cannot be put inside another comment. Second the double-dash
sequence "--" may not appear inside a comment except as part of the closing --> tag. You must also make sure that there are no
spaces in the start-of comment string.

Valid comment:

Example:

<html>

<head>

<title>Valid Comment Example</title>

</head>

<body>
<!-- This is valid comment -->
<p>This is the valid comment.....</p>
</body>
</html>
Output:
Invalid comment:
Example:
<!DOCTYPE html>
<html>
<head>
<title>Invalid Comment Example</title>
</head>
<body>
< !-- This is not a valid comment -->
<p>Invalid comment...</p>
</body>
</html>
Output:

MULTILINE COMMENT

In HTML code, we can also comment multiple lines at a time. In multiline comment we can use any description about code
or multiple line code to debug, etc.

SYNTAX

<!---
Your code is commented.
Write description of code.
It will not display at webpage.
-->

Example:

<html>
<head>
<title>Example of HTML comment multiple lines of code</title>

</head>
<body>
<h1> HTML comment multiple lines of code </h1>
<!-- <h1> tag is a title of your page
and do not display <img border="2" src="nice_toen.jpg" alt="nice town">,
so this is a code of multilines comment -->
</body>
</html>

Output:
CONDITIONAL COMMENTS

Conditional comments only work in Internet Explorer (IE) on Windows but they are ignored
by other browsers.

Example:

<head>
<title>Conditional Comments</title>
<!--[if IE 6]>
Special instructions for IE 6 here
<![endif]-->
</head>
<body>
<p>This is the content </p>
</body>
</html>

Output:

USING COMMENT TAG

There are few browsers that support <comment> tag to comment a part of HTML code.
Example:

<head>

<title>Using Comment Tag</title>

</head>

<body>

<p>You are learning <comment>not</comment> Multimedia</p>

</body>

</html>

Output:

COMMENTING STYLE CODE

If you are using Java Script or VB Script in your HTML code then it is recommended to put that script code inside proper
HTML comments so that old browsers can work properly.

Example:

<html>
<head>
<title>Commenting Script Code</title>
<script>
<!--
document.write("Hello World!")
//-->
</script>
</head>
<body>
<p>Hello , World!</p>
</body>
</html>

Output:

COMMENTING STYLE SHEETS

If you are using Cascading Style Sheet (CSS) in your HTML code then it is recommended to put that style sheet code inside
proper HTML comments so that old browsers can work properly.

Example:

<html>

<head>

<title>Commenting Style Sheets</title>

<style>

<!--

.example {

border:4px solid #4a7d49

//-->

</style>

</head>

<body>

<div class = "example">Hello ,HTML!</div>

</body>

</html>

Output:
8. HTML - FONTS

Fonts play a very important role in making a website more user friendly and increasing content readability. Font face and
color depends entirely on the computer and browser that is being used to view your page but you can use HTML <font> tag to add
style, size, and color to the text on your website. You can use a <basefont> tag to set all of your text to the same size, face, and
color.

SET FONT SIZE

You can set content font size using size attribute. The range of accepted values is from 1(smallest) to 7(largest). The default
size of a font is 3.

Example:
<html>
<head>
<title>Setting Font Size</title>
</head>
<body>
<font size="1">Hello World</font><br />
<font size="2"> Hello World </font><br />
<font size="3"> Hello World </font><br />
<font size="4"> Hello World </font><br />
<font size="5"> Hello World </font><br />
<font size="6"> Hello World </font><br />
<font size="7"> Hello World </font>
</body>
</html>

Output:

SETTING FONT FACE

You can set font face using face attribute but be aware that if the user viewing the page doesn't have the font installed, they
will not be able to see it. Instead user will see the default font face applicable to the user's computer.

Example:

<html>
<head>
<title>Font Face</title>
</head>
<body>
<font face="Times New Roman" size="4">Times New Roman</font><br />
<font face="Candara " size="4">Verdana</font><br />
<font face="High tower text " size="5">Comic Sans MS</font><br />
<font face="Georgia " size="4">WildWest</font><br />
<font face="Bedrock" size="4">Bedrock</font><br />
</body>
</html>
Output:

SETTING FONT COLOR

You can set any font color you like using color attribute. You can specify the color that you want by either the color name or
hexadecimal code for that color.

Example:

<html>
<head>
<title>Setting Font Color</title>
</head>
<body>
<font color="violet ">The text will be in violet</font><br />
<font color="Green"> The text will be in green</font>
</body>
</html>

Output:

RELATIVE FONT SIZE

You can specify how many sizes larger or how many sizes smaller than the preset font size should be. You can specify it
like <font size = "+n"> or <font size = "−n">

Example:

<html>

<head>

<title>Hello Web Technology!</title>

</head>

<body>

<font size = "-1">HTML size = "-1"</font><br />

<font size = "+1">HTML size = "+1"</font><br />

<font size = "+2">HTML size = "+2"</font><br />

<font size = "+3">HTML size = "+3"</font><br />

<font size = "+4">HTML size= "+4"</font>

</body>

</html>
Output:

ALTERNATIVE FONT FACE

It is possible to specify two or more font face alternatives by listing the font face names, separated by a comma. If the user
doesn't have one Font installed in his system, the other can display the content.

Example:

<html lang="en">

<head>

<meta charset="UTF-8">

<title> HTML Font Face Alternative Attribute </title>

</head>

<body>

<font face="Times New Roman,Verdana,Comic sans MS,WildWest" size="5">Times New Roman</font><br />

<font face="Lucida Calligraphy,Comic Sans MS,Lucida Console" size="5">Bedrock</font>

</body>

</html>

Output:

THE <basefont> ELEMENT

The <basefont> element is supposed to set a default font size, color, and typeface for any parts of the document that are not
otherwise contained within a <font> tag. You can use the <font> elements to override the <basefont> settings.

Example:

<head>
<style>
body {
color: red;
}
</style>
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>

Output:

MULTIPLE CHOICE QUESTIONS

1. The __________ tag is useful during the debugging of codes.

a. comment
b. Table
c. Font
d. Form

2. __________only work in Internet Explorer (IE) on Windows but they are ignored

a. Conditional comments
b. Multiline comments
c. Single line comment
d. None of the above

3. Which is the correct way to comment out something in HTML?


a. Using ## and #
b. Using <!-- and -->
c. Using </-- and -/->
d. Using <!-- and -!>

4. The ________is useful during the debugging of codes.

a. comment tag
b. Font tag
c. Form tag
d. List tag

5. The ________tag defines the font characteristics.

a. font
b. comment
c. Table
d. form

6. You can set any font color you like using _____ attribute.

a. face
b. size
c. color
d. none of the above

7. The ______element is supposed to set a default font size, color, and typeface

a. <basefont>
b. <font>
c. <list>
d. <form>

8. Which of the following is the correct way to change the font face in HTML?
a. <font name = "Calibri"> ……… </font>
b. <font face = "Calibri"> ……… </font>
c. <font = "Calibri"> ……… </font>
d. None of the above

6 MARK QUESTIONS

1. Explain the comment tag with example.

2. Explain the attributes of font in HTML with example.

12 MARK QUESTIONS

1. What is HTML Font? How to set font size in HTML? Give an example.

2. What are the types of comment tag in HTML ? Explain with example.
9. HTML - MARQUEES

The marquee tag is a non-standard HTML element which causes text to scroll up, down, left or right automatically.

Marquee is one of the important tags introduced in HTML to support such scrollable texts and images within a web page.

THE MARQUEE TAG

The <marquee> tag is a container tag of HTML is implemented for creating scrollable text or images within a web page from
either left to right or vice versa, or top to bottom or vice versa.

The different attributes of <marquee> tag are:

ATTRIBUTE DESCRIPTION

Width provides the width or breadth of a marquee. For example width="10" or


width="20%"
Height provides the height or length of a marquee. For example height="20" or
height="30%"
Direction provides the direction or way in which your marquee will allow you to
scroll. The value of this attribute can be: left, right, up or down
scrolldelay provides a feature whose value will be used for delaying among each
jump.
scrollamount provides value for speeding the marquee feature

behavior provides the scrolling type in a marquee. That scrolling can be like
sliding, scrolling or alternate
Loop provides how many times the marquee will loop

bgcolor provides a background color where the value will be either the name of
the color or the hexadecimal color-code.
vspace provides a vertical space and its value can be like: vspace="20" or
vspace="30%"
hspace provides a horizontal space and its value can be like: vspace="20" or
vspace="30%"

Example:

Scroll up:

<html>
<head>
<title>Example for HTML Marquee Tag</title>
</head>
<marquee width="40%" direction="up" height="30%">
This is sample scrolling text.
</marquee>
</html>
Output:

Example:

Scroll down:

<marquee width="60%" direction="down" height="100px">


This is a sample scrolling text that has scrolls texts to down.
</marquee>

Output:

Example:

Scroll left to right:

<marquee width="60%" direction="right" height="100px">


This is a sample scrolling text that has scrolls texts to right.
</marquee>

Output:

Example:

Scroll right to left:

<marquee width="60%" direction="left" height="100px">


This is a sample scrolling text that has scrolls texts to left.
</marquee>

Output:

SCROLLING SPEED

Marquee speed can be changed using the "scrollmount" attribute. For example, if you are using scrollmount = "1" then it sets the
marque to scroll very slowly, and as you increase the "scrollmount," the scrolling speed will also increase

Example:

<marquee behavior="scroll" direction="up" scrollamount="1">Slow Scrolling</marquee>


<marquee behavior="scroll" direction="right" scrollamount="12">Little Fast Scrolling</marquee>
<marquee behavior="scroll" direction="left" scrollamount="20">Fast Scrolling</marquee>
<marquee behavior="scroll" direction="right" scrollamount="50">Very Fast Scrolling</marquee>

Output:
10. HTML - IMAGES

• The HTML <img> tag is used to embed an image in a web page.

• Images are not technically inserted into a web page; images are linked to web pages. The <img> tag creates a holding space
for the referenced image.

• The <img> tag is empty, it contains attributes only, and does not have a closing tag.

The <img> tag has two required attributes:

• src - Specifies the path to the image

• alt - Specifies an alternate text for the image

SYNTAX

<img src="url"
alt="alternatetext">

INSERT IMAGE

You can insert any image in your web page by using <img> tag.

SYNTAX

<img src = "Image URL" ... attributes-list/>

Example:

<!DOCTYPE html>
<html>
<body>
<h2>HTML Image</h2>
<img src="pic_trulli.jpg" alt="Trulli" width="500" height="333">
</body>
</html>

Output:

SET IMAGE LOCATION

Usually we keep all the images in a separate directory. So let's keep HTML file test.htm in our home directory and create a
subdirectory images inside the home directory where we will keep our image test.png.

Example:

<!DOCTYPE html>
<html>
<head>
<title>Using Image in Webpage</title>
</head>
<body>
<p>Simple Image Insert</p>
<img src = "/html/images/test.png" alt = "Test Image" />
</body>
</html>

THE src ATTRIBUTE

• The required src attribute specifies the path (URL) to the image.

• When a web page loads; it is the browser, at that moment, that gets the image from a web server and inserts it into the page.
Therefore, make sure that the image actually stays in the same spot in relation to the web page, otherwise your visitors will get a
broken link icon. The broken link icon and the alt text are shown if the browser cannot find the image.

<img src="img_chania.jpg" alt="Flowers in Chania">

Example:

<!DOCTYPE html>
<html>
<body>
<h2>Alternative text</h2>
<p>The alt attribute should reflect the image content, so users who cannot see the image gets an understanding of what the image
contains:</p>
<img src="img_chania.jpg" alt="Flowers in Chania" width="460" height="345">
</body>
</html>

Output:

THE alt ATTRIBUTE

The required alt attribute provides an alternate text for an image, if the user for some reason cannot view it (because of slow
connection, an error in the src attribute, or if the user uses a screen reader).

<img src="img_chania.jpg" alt="Flowers in Chania">

IMAGE SIZE - WIDTH AND HEIGHT

You can use the style attribute to specify the width and height of an image.

<img src="img_girl.jpg" alt="Girl in a jacket"


style="width:500px;height:600px;">

Example:

<!DOCTYPE html>
<html>
<body>
<h2>Image Size</h2>
<p>Here we specify the width and height of an image with the width and height attributes:</p>
<img src="img_girl.jpg" alt="Girl in a jacket" width="500" height="600">
</body>
</html>

Output:

SET IMAGE BORDER

By default, image will have a border around it, you can specify border thickness in terms of pixels using border attribute. A
thickness of 0 means, no border around the picture.

Example:

<!DOCTYPE html>
<html>
<head>
<style>
img {
border: 5px solid #555;
}
</style>
</head>
<body>
<h2>Border Around Image</h2>
<p>Use the border property to add a border to an image:</p>
<img src="img_snow.jpg" alt="Snow" style="width:150px">
</body>
</html>

Output:

SET IMAGE ALIGNMENT

By default, image will align at the left side of the page, but you can use align attribute to set it in the center or right.
ATTRIBUTE VALUE EXPLANATION

align=" " Vertical alignment

top aligns to the top

middle aligns to the middle

bottom aligns to the bottom (default)

Floats image

left the image floats to the left


(the text wraps to the right of the
image)
right the image floats to the right
(the text wraps to the left of the
image)

Example:

Aligns to the top:

<p>
<img src="image/example.jpg" alt="Example" align="top">
Aligns to the top
<br>
The text aligns to the top of the image.
</p>

Output:

Aligns to the middle:

<p>
<img src="image/example.jpg" alt="Example" align="middle">
Aligns to the middle
<br>
The text aligns to the middle of the image.
</p>

Output:
Aligns to the bottom:

<p>
<img src="image/example.jpg" alt="Example" align="bottom">
Aligns to the bottom (Default)
<br>
The text aligns to the bottom of the image.
</p>

Output:

Aligns to the left:

<p>
<img src="image/example.jpg" alt="Example" align="left">
Aligns to the left
<br>
The image floats to the left.
<br>
And the text wraps to the right of the image.
<br clear="left">
Clears the left
</p>

Output:

Aligns to the right:

<p>
<img src="image/example.jpg" alt="Example" align="right">
Aligns to the right
<br>
The image floats to the right.
<br>
And the text wraps to the left of the image.
<br clear="right">
Clears the right
</p>

Output:
COMMON IMAGE FORMATS

The most common image file types, which are supported in all browsers (Chrome, Edge, Firefox, Safari, Opera):

ABBREVIATION FILE FORMAT FILE EXTENSION

APNG Animated Portable .apng


Network Graphics
GIF Graphics .gif
Interchange Format
ICO Microsoft Icon .ico, .cur
JPEG Joint Photographic .jpg, .jpeg, .jfif, .pjpeg,
Expert Group image .pjp
PNG Portable Network .png
Graphics
SVG Scalable Vector .svg
Graphics

HTML IMAGE TAGS

TAG DESCRIPTION

<img> Defines an image


<map> Defines an image map
<area> Defines a clickable area
inside an image map
<picture> Defines a container for
multiple image resources

MULTIPLE CHOICE QUESTIONS

1) How to add a background color in HTML?

a.<marquee bg color: "red">


b.<marquee bg-color = "red">
c.<marquee bgcolor = "red">
d.<marquee color = "red">

2) Marquee is a tag in HTML to

a.mark the list of items to maintain inqueue


b.mark the text so that it is hidden in browser
c.display text with scrolling effect
d.none of these

3) A tag which is used for overriding the current text direction. e.g. Right to left side

a.<bdo dir = "rtl"> </bdo>


b.<bdo dir = "ltr"> </bdo>
c.<bdo = "right to left"> </bdo>
d.none
4) If you want to change the color to Red which of the following tags will you use?

a.<Body Text = Red>


b.<Body Bgcolor = Red>
c.<Body Colour = Red>
d.None of these

5) Which of the following HTML tag is used to display the text with scrolling effect?

a.<marquee>
b.<scroll>
c.<div>
d.None of the above

6) How to insert a background image in HTML?

a.<body background = "img.png">


b.<img background = "img.png">
c.<bg-image = "img.png">
d.None of the above

7) How to insert an image in HTML?

a.<img href = "jtp.png" />


b.<img url = "jtp.png" />
c.<img link = "jtp.png" />
d. <img src = "jtp.png" />

8) The type of tag used for inserting an image in web document is

a.<imp>
b.<img>
c.<image>
d.<src>

6 MARK QUESTION

1. What is an Image Tag in HTML? How to insert an image in HTML?

12 MARK QUESTION

1. How will you scroll the text in HTML? Explain them briefly.
11. HTML - TEXT LINKS

Links are found in nearly all web pages. Links allow users to click their way from page to page.HTML links are hyperlinks.
You can click on a link and jump to another document.When you move the mouse over a link, the mouse arrow will turn into a
little hand.

The HTML <a> tag defines a hyperlink.

SYNTAX

<a href="url">link text</a>

The most important attribute of the <a> element is the href attribute, which indicates the link's destination.The link text is the
part that will be visible to the reader.

Example:

<!DOCTYPE html>

<html>

<head>

<title>Hyperlink Example</title>

</head>

<body>

<p>Click following link</p>

<a href = "https://www.hayclothing.in " target = "_self">hayclothing</a>

</body>

</html>

Output:
THE target ATTRIBUTE
The target attribute specifies where to open the linked document.

S.NO OPTION & DESCRIPTION

1 _blank

Opens the linked document in a new window or tab.

2 _self

Opens the linked document in the same frame.

3 _parent

Opens the linked document in the parent frame.

4 _top

Opens the linked document in the full body of the window.

5 Targetframe

Opens the linked document in a named targetframe.

Example:

<!DOCTYPE html>

<html>

<head>

<title>Hyperlink Example</title>

<base href = "https://www.hayclothing.in">

</head>

<body>

<p>Click any of the following links</p>

<a href = "/html/index.htm" target = "_blank">Opens in New</a> |

<a href = "/html/index.htm" target = "_self">Opens in Self</a> |

<a href = "/html/index.htm" target = "_parent">Opens in Parent</a> |

<a href = "/html/index.htm" target = "_top">Opens in Body</a>


</body>

</html>

Output:

USE OF BASE PATH


When you link HTML documents related to the same website, it is not required to give a complete URL for every link. You
can get rid of it if you use <base> tag in your HTML document header. This tag is used to give a base path for all the links. So
your browser will concatenate given relative path to this base path and will make a complete URL.

Example:

<!DOCTYPE html>

<html>

<head>

<title>Hyperlink Example</title>

<base href = "https://www.hayclothing.in">

</head>

<body>

<p>Click following link</p>

<a href = "/html/index.htm" target = "_blank">HTML hayclothing</a>

</body>

</html>
Output:

DOWNLOAD LINKS
You can create text link to make your PDF, or DOC or ZIP files downloadable. This is very simple; you just need to give
complete URL of the downloadable file as follows –

Example:

<!DOCTYPE html>

<html>

<head>

<title>Hyperlink Example</title>

</head>

<body>

<a href = "https://www.hayclothing.in/page.pdf">Download PDF File</a>

</body>

</html>

Output:

SETTING LINK COLORS

You can set colors of your links, active links and visited links using link, alink and vlink attributes of <body> tag.

Example:

Save the following in test.htm and open it in any web browser to see how link, alink and vlink attributes work.
Example:

<html>

<head>

<title>Hyperlink Example</title>

<base href = "https://www.hayclothing.in/">

</head>

<body alink = "#54A250" link = "#040404" vlink = "#F40633">

<p>Click following link</p>

<a href = "/html/index.htm" target = "_blank" >hayclothing</a>

</body>

</html>

Output:

LINKING TO A WEB PAGE

We can also create bookmark anchors to allow users to jump to a specific section of a web page. Bookmarks are especially
helpful if you have a very long web page.
Creating bookmarks is a two-step process: first add the id attribute on the element where you want to jump, then use
that id attribute value preceded by the hash sign (#) as the value of the href attribute of the <a> tag

Example:

<!DOCTYPE html>
<html lang="en">
<head>
<title>Creating Bookmarks in HTML</title>
<style>
h2 + p{
line-height: 75px;
}
</style>
</head>
<body>
<p><a href="#sectionA">Jump to Section A</a></p>
<p><a href="#sectionB">Jump to Section B</a></p>
<p><a href="#sectionC">Jump to Section C</a></p>

<h2 id="sectionA">Section A</h2>


<p>The first version of HTML was written by Tim Berners-Lee in 1993. Since then, there have been many different versions of
HTML. The most widely used version throughout the 2000's was HTML 4.01, which became an official standard in December
1999. Another version, XHTML, was a rewrite of HTML as an XML language.</p>

<h2 id="sectionB">Section B</h2>


<p>Another version, XHTML, was a rewrite of HTML as an XML language. XML is a standard markup language that is used to
create other markup languages. Hundreds of XML languages are in use today, including GML (Geography Markup Language),
MathML, MusicML, and RSS (Really Simple Syndication). Since each of these languages was written in a common language
(XML), their content can easily be shared across applications. This makes XML potentially very powerful, and it's no surprise that
the W3C would create an XML version of HTML (again, called XHTML).</p>

<h2 id="sectionC">Section C</h2>


<p>Most pages on the Web today were built using either HTML 4.01 or XHTML 1.0. However, in recent years, the W3C (in
collaboration with another organization, the WHATWG), has been working on a brand new version of HTML, HTML5. Currently
(2011), HTML5 is still a draft specification, and is not yet an official standard.</p>
</body>
</html>

Output:
12. HTML - IMAGE LINKS

To use image as a link in HTML, use the <img> tag as well as the <a> tag with the href attribute. The <img> tag is for
using an image in a web page and the <a> tag is for adding a link. Under the image tag src attribute, add the URL of the image.
With that, also add the height and width.

Example:

<!DOCTYPE html>

<html>

<head>

<title>Image Hyperlink Example</title>

</head>

<body>

<p>Click following link</p>

<a href = "https://www.hayclothing.in" target = "_self">

<img src = "C:\Users\Lenovo\hay.png" alt = "hayclothing" border = "0"/>

</a>

</body>

</html>

Output:

MOUSE - SENSITIVE IMAGES


Server-side image maps − This is enabled by the ismap attribute of the <img> tag and requires access to a server and
related image-map processing applications.

Client-side image maps − This is created with the usemap attribute of the <img> tag, along with corresponding <map>
and <area> tags.

CLIENT - SIDE IMAGE MAPS


Client side image maps are enabled by the usemap attribute of the <img /> tag and defined by special <map> and <area>
extension tags.
The image that is going to form the map is inserted into the page using the <img /> tag as a normal image, except it carries
an extra attribute called usemap. The value of the usemap attribute is the value which will be used in a <map> tag to link map and
image tags. The <map> along with <area> tags define all the image coordinates and corresponding links.

The <area> tag inside the map tag, specifies the shape and the coordinates to define the boundaries of each clickable hotspot
available on the image.

SERVER - SIDE IMAGE MAPS


You can put your image inside a hyper link and use ismap attribute which makes it special image and when the user clicks
some place within the image, the browser passes the coordinates of the mouse pointer along with the URL specified in the <a> tag
to the web server. The server uses the mouse-pointer coordinates to determine which document to deliver back to the browser.

When ismap is used, the href attribute of the containing <a> tag must contain the URL of a server application like a cgi or
PHP script etc. to process the incoming request based on the passed coordinates.

The coordinates of the mouse position are screen pixels counted from the upper-left corner of the image, beginning with
(0,0). The coordinates, preceded by a question mark, are added to the end of the URL.

Example:

<!DOCTYPE html>

<html>

<head>

<title>ISMAP Hyperlink Example</title>

</head>

<body>

<p>Click following link</p>

<a href = "/cgi-bin/ismap.cgi" target = "_self">

<img ismap src = "C:\Users\Lenovo\Downloads.png" alt = "hayclothing" border = "0"/>

</a>

</body>

</html>

Output:
MULTIPLE CHOICE QUESTIONS

1. Which one of the following value of target attribute opens the linked url in a new tab?

A. _self

B. _blank

C. _top

D. _parent

2.Which one of the following tag is used for creating a hyperlink?

A.<link>

B. <hyperlink>

C. <a>

D. <title>

3. Which attribute is used to give destination address in <a> tag of HTML?

A. href

B. type

C. address

D. Link

4. Choose the correct option.

A. destination address is specified as value of href between and tag.

B. address specified as value of href in HTML have to be absolute.

C. address specified as value of href in HTML have to be relative.

D. address specified as value of href in HTML can be absolute or relative.

5. What will the browser display for the above HTML code?

<a href="home.php">Go to Home Page</a>

A. It will display the entire line as it is.

B. It will display- Go to Home Page

C. It will display- Go to Home Page(link)

D. First it will display home.php, and upon clicking it, it will display Go to Home Page.(link)
6. By default, an unvisited link in HTML is-

A. purple and underlined.

B. blue and underlined.

C. red and underlined.

D. blue and italics.

7.<img> tag is used for ___ images.

A.inserting

B.deleting

C.displaying

D.none

8.The correct HTML code for inserting an image is

A.<img href=”image.gif”>

B.<img> image.gif</gif>

C.<img src = “image.gif”>

D.<image src = “image.gif” >

6 MARK QUESTION

1.Explain image links with an suitable example.

12 MARK QUESTION

1. Describe Text links with their attributes and example.


13. HTML - EMAIL LINKS

It is not difficult to put an HTML email link on your webpage but it can cause unnecessary spamming problem for your
email account. There are people, who can run programs to harvest these types of emails and later use them for spamming in various
ways.
You can have another option to facilitate people to send you emails. One option could be to use HTML forms to collect user
data and then use PHP or CGI script to send an email.

A simple example, we take user feedback using this form and then we are using one CGI program which is collecting this
information and sending us email to the one given email ID.

HTML EMAIL TAG


HTML <a> tag provides you option to specify an email address to send an email. While using <a> tag as an email tag, you
will use mailto: email address along with href attribute. Following is the syntax of using mailto instead of using http.
Example:
<a href = "mailto: bhuvana@example.com">Send Email</a>

This code will generate the following link which you can use to send email.

Now, if a user clicks this link, it launches one Email Client (like Lotus Notes, Outlook Express etc.) installed on your user's
computer. There is another risk to use this option to send email because if user do not have email client installed on their computers
then it would not be possible to send email.
DEFAULT SETTINGS
You can specify a default email subject and email body along with your email address.
Example:
<a href="mailto:bhuvna@gmail.com?subject=Hello&good morning=Message">
Send Hello
</a>
This code will generate the following link which you can use to send email.

TO CREATE A STEPS IN EMAIL LINKS


STEP 1:
Type the anchor tag <a href= in your HTML document. The "<a href=" attribute begins the link in your HTML
document. The "<a href=" tag generally tells the browser that the following item is a link.
 You'll need to add all HTML code up to this point before crossing any further into the document
STEP 2:
Type mailto: after the "=" sign. This tells the web browser that the following link is to an email address, rather than a
web page.

STEP 3:
Type the users email next. A properly formatted command so-far would be <a
href=mailto:<nowiki> email@sample.com".
STEP 4:
Add a pre-made subject-line (optional). If you wish to add a pre-made subject, type a question mark (?) after the user's
email address, followed by the word "subject" (without the quotation marks), followed by an equals sign (=), followed by the
subject inside a pair of quotation marks.
 If you want to add this to your command, it should look like this so far: <a
href=mailto:<nowiki>agentavery@sample.com?subject="subject text"
 Try not to use characters that aren't alphanumeric in the subject line. There are ways to work around this so your link
doesn't get stumped and thinks it's part of something else".
 While most often not used, it is possible to add information to prefill the subject line via the mailto syntax. However,
it's more often used when the mail is being sent to a server inside a robot that handles incoming mail so it can be
processed later (so it can be filtered).
 You can add "body" as well as a cc or a bcc line using a similar syntax. Just make sure to use a question mark
followed by the term "body","cc", or "bcc" followed by an equals sign followed by the text for that line in a pair of
quotation marks.

STEP 5:
Type > to add a closing bracket. So far, our HTML commands tell the web browser what email address to link to,
and to add a subject/cc/bcc. The closing bracket ">" tells the web browser that there are no more commands to execute when the
link is clicked.
STEP 6:
Type link text. This is the text the user clicks on to open the email link. It goes after the closing bracket. This can be a
word, a phrase, or even a duplicate copy of the person's email address this is being sent to. Most often, this can be the phrase "here"
or "this" or something of that sort.

STEP 7:
1. Type </a> after the link text. This closes the HTML command. HTML anchor tags must have closure for this trick to work
and not make the remainder of the page become an extension of the anchor tag.
 The entire HTML email link command should look something like this: <a
href=mailto:<nowiki>agentavery@sample.com?subject="HTML link">Click here to send
us an email!!!</a>
STEP 8:
Continue the remainder of the HTML document. Be sure to save your work. If you have more HTML to add to your
document, continue your work.
14. HTML - TABLES

A table is an arrangement of data in rows and columns, or possibly in a more complex structure. Tables are useful for various
tasks such as presenting text information and numerical data. ... Tables can be used to compare two or more items in tabular
form layout

Define an HTML Table:

The <table> tag defines an HTML table.

Each table row is defined with a <tr> tag. Each table header is defined with a <th> tag. Each table data/cell is defined with
a <td> tag.

By default, the text in <th> elements are bold and centered.

By default, the text in <td> elements are regular and left-aligned.

Example:

<!DOCTYPE html>

<html>

<style>

table, th, td {

border:1px solid black;

</style>

<body>

<h2>A basic HTML table</h2>

<table style="width:100%">

<tr>

<th>NAME</th>

<th>CLASS</th>

<th>MARK</th>

</tr>

<tr>

<td>BHUVANSEHWARI</td>

<td>B.Sc information technology</td>

<td>89</td>

</tr>

<tr>

<td>HEMA DEVI</td>

<td>B.Com CA</td>
<td>90</td>

</tr>

</table>

</body>

</html>

Output:

TABLE HEADING

HTML headings are titles or subtitles that you want to display on a webpage. HTML headings are defined with
the <h1> to <h6> tags. <h1> defines the most important heading. <h6> defines the least important heading.

Example:

<!DOCTYPE html>

<html>

<head>

<title>HTML Table Header</title>

</head>

<body>

<table border="1">

<tr>

<th>Name</th>

<th>Salary</th>

</tr>

<tr>

<td>BHUVANESHWARI</td>

<td>5000</td>

</tr>
<tr>

<td>HEMA DEVI</td>

<td>7000</td>

</tr>

</table>

</body>

</html>

Output:

CELL PADDING AND CELL SPACING ATTRIBUTES

CELLPADDING

Cellpadding specifies the space between the border of a table cell and its contents (i.e) it defines the whitespace between
the cell edge and the content of the cell.
SYNTAX

<table cellpadding="value" >. . . . </table>

where, value determines the padding (space between the border of a table and its content)

CELL SPACING

Cell spacing specifies the space between cells (i.e) it defines the whitespace between the edges of the adjacent cells.
SYNTAX

<table cell spacing="value" >.....</table>

where, value determines the padding (space between adjacent cells)

Example:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width,
initial-scale=1.0">
<title>Document</title>
<style>
span{
text-decoration-style: solid;
width: 25px;
font-size: x-large;
color: blueviolet;
}
</style>
</head>
<body>
<table border="1"
cellpadding="4"
cell spacing="5">
<thead>
<td><span>Name</span></td>
<td><span>Age</span></td>
</thead>
<tbody>
<tr>
<td>BUNA</td>
<td>30</td>
</tr>
<tr>
<td>SAMU</td>
<td>35</td>
</tr>
<tr>
<td>HEMA</td>
<td>17</td>
</tr>
<tr>
<td>VARSHU</td>
<td>13</td>
</tr>
</tbody>
</table>
</body>
</html>

Output:

COLSPAN AND ROWSPAN ATTRIBUTES

Attribute of

<th> — table header — A header cell in a <table>.

<td> — table data — A data cell in a <table>.

What does col span= do?


Allows a single table cell to span the width of more than one cell or column.

What does row span= do?


Allows a single table cell to span the height of more than one cell or row.
Why use col span= or row span=?
Sometimes it makes sense for a cell to span multiple columns or multiple rows. This might be used for a header cell that
titles a group of columns, or a side-bar that groups rows of entries.

Both col span= and row span= are attributes of the two table-cell elements, <th> and <td>. They provide the same functionality
as “merge cell” in spreadsheet programs like Excel.
The value of either attribute must be a positive integer (a whole number). The value specifies the number of columns or rows
that the cell fills.

Example:

<!DOCTYPE html>

<html>

<head>

<title>HTML Table Colspan/Rowspan</title>

</head>

<body>

<table border="1">

<tr>

<th>NAME</th>

<th>MARK 1</th>

<th>MARK 2</th>

</tr>

<tr><td rowspan="2">BHUVANA</td><td>80</td><td>85</td></tr>

<tr><td>79</td><td>80</td></tr>

<tr><td colspan="3">TOTAL</td></tr>

</table>

</body>

</html>

Output:
TABLE BACKGROUND

In HTML, table background color is defined using Cascading Style Sheets (CSS). Specifically, you use the background-
color property to define background color. You can apply this property against the whole table, a row, or a single cell.

Example:

<!DOCTYPE html>

<html>

<head>

<title>HTML Table Background</title>

</head>

<body>

<table border="1" bordercolor="BLACK" bgcolor="RED">

<tr>

<th>NAME</th>

<th>MARK 1</th>

<th>MARK 2</th>

</tr>

<tr><td rowspan="2">BHUVANA</td><td>80</td><td>90</td></tr>

<tr><td>80</td><td>70</td></tr>

<tr><td colspan="3">TOTAL</td></tr>

</table>

</body>

</html>

Output:

TABLE HEIGHT AND WIDTH

HEIGHT

The HTML <td> height Attribute is used to specify the height of the table cell. If the <td> height attribute is not set
then it takes default height according to content.
SYNTAX

<td height="pixels | %">

Attribute Values:

 pixels: It sets the height of the table cell in terms of pixels.


 %: It sets the height of the table cell in terms of percentage (%).

WIDTH

The HTML <td> width Attribute is used to specify the width of a table cell. If width attribute is not set then it takes
default width according to content.

SYNTAX

<td width="pixels | %">


Attribute Values:

 pixels: It sets the width of table in terms of pixels.


 %: It sets the width of table in terms of percentage (%).

Example:

<!DOCTYPE html>

<html>

<head>

<title>HTML Table Width/Height</title>

</head>

<body>

<table border="1" width="400" height="150">

<tr>

<td>NAME</td>

<td>CLASS</td>

</tr>

<tr>

<td>BHUVANESHWARI</td>

<td>B.Sc IT</td>

</tr>

</table>

</body>

</html>
Output:

TABLE CAPTION

The <caption> tag defines a table caption.The <caption> tag must be inserted immediately after the <table> tag.

By default, a table caption will be center-aligned above a table. However, the CSS properties text-align and caption-side can
be used to align and place the caption.

Example:

<!DOCTYPE html>

<html>

<head>

<title>HTML Table Caption</title>

</head>

<body>

<table border="1" width="100%">

<caption>NO OF STUDENTS</caption>

<tr>

<td>1</td><td>BHUVANESHWARI</td>

</tr>

<tr>

<td>2</td><td>HEMA DEVI</td>

</tr>

<tr>

<td>3</td><td>VARSHINI</td>
</tr>

</table>

</body>

</html

Output:

TABLE HEADER, BODY AND FOOTER

FOOTER

The <tfoot> tag is used to group footer content in an HTML table.The <tfoot> element is used in conjunction with
the <thead> and <tbody> elements to specify each part of a table (footer, header, body).

Browsers can use these elements to enable scrolling of the table body independently of the header and footer. Also, when
printing a large table that spans multiple pages, these elements can enable the table header and footer to be printed at the top and
bottom of each page.

Note: The <tfoot> element must have one or more <tr> tags inside.

The <tfoot> tag must be used in the following context: As a child of a <table> element, after
any <caption>, <colgroup>, <thead>, and <tbody> elements. The <thead>, <tbody>, and <tfoot> elements will not affect the layout
of the table by default. However, you can use CSS to style these elements .

BODY

The <tbody> tag is used to group the body content in an HTML table.The <tbody> element is used in conjunction with
the <thead> and <tfoot> elements to specify each part of a table (body, header, footer).

Browsers can use these elements to enable scrolling of the table body independently of the header and footer. Also, when
printing a large table that spans multiple pages, these elements can enable the table header and footer to be printed at the top and
bottom of each page.

Note: The <tbody> element must have one or more <tr> tags inside.

The <tbody> tag must be used in the following context: As a child of a <table> element, after any <caption>, <colgroup>,
and <thead> elements. The <thead>, <tbody>, and <tfoot> elements will not affect the layout of the table by default. However, you
can use CSS to style these elements.

HEADER

The <header> element represents a container for introductory content or a set of navigational links.

A <header> element typically contains:


 one or more heading elements (<h1> - <h6>)
 logo or icon
 authorship information

Note: You can have several <header> elements in one HTML document. However, <header> cannot be placed within a <footer>,
<address> or another <header> element.

Example:

<!DOCTYPE html>

<html>

<head>

<title>HTML Table</title>

</head>

<body>

<table border="1" width="100%">

<thead>

<tr>

<td colspan="4">NO OF STUDENTS</td>

</tr>

</thead>

<tfoot>

<tr>

<td colspan="4">TOTAL</td>

</tr>

</tfoot>

<tbody>

<tr>

<td>BHUNA</td>
<td>HEMA</td>

<td>VARSHU</td>

<td>KAVYA</td>

</tr>

</tbody>

</table>

</body>

</html>

Output:

NESTED TABLE

The nested table in HTML means creating a table on a webpage inside another table on the same web page.

Example:

<!DOCTYPE html>

<html>

<head>

<title>HTML Table</title>

</head>

<body>

<table border="1" width="100%">

<tr>

<td>

<table border="1" width="100%">

<tr>
<th>Name</th>

<th>TOTAL</th>

</tr>

<tr>

<td>BHUVANESHWARI</td>

<td>456</td>

</tr>

<tr>

<td>HEMA DEVI</td>

<td>478</td>

</tr>

</table>

</td>

</tr>

</table>

</body>

</html>

Output:

MULTIPLE CHOICE QUESTIONS

1.We can include default subject heading and body text by passing query parameter(s) separated by _____________ symbol.

A) Colon

B) Question Mark

C) Ampersand
D)Comma

2. In HTML, if we need to send the email then href attribute of anchor tag starts with a keyword:

A) email

B) mailto

C) none of these

D) mail

3. Symbol which is written immediately after mail to keyword in href attribute of anchor tag is:

A) Colon

B) semicolon

C) hash

D) comma

4.In HTML tables table rows is defined by:

A) <th> tag
B) <tr> tag
C) <td> tag
D) <row> tag

5. In HTML tables gap between two cells of same tables are known as :

A) cell spacing
B) cell difference
C) cell pading
D) All of above

6.In HTML tables table header is defined by:

A) <th> tag
B) <tr> tag
C) <td> tag
D) <t head> tag

7.If you want to merge two or more rows in a tables which attributes you can use

A) Rowmerge
B) Rowspan
C)colmerge
D)colspan

8.Which of following element is used for creating a separate table footer?

A) <footer>
B) <sepfooter>
C) <tfoot>
D) None of them
6 MARK QUESTION

1.How to create a Email links in HTML?

12 MARK QUESTION

1.Explain the types of tables in HTML?


15. HTML - FRAMES

HTML frames are used to divide your browser window into multiple sections where each section can load a separate HTML
document. A collection of frames in the browser window is known as a frameset. The window is divided into fraes in a similar way
the tables are organized: into rows and columns.

Disadvantages of Frames:

There are few drawbacks with using frames, so it's never recommended to use frames in your webpages:

1. Some smaller devices cannot cope with frames often because their screen is not big enough to be divided up.
2. Sometimes your page will be displayed differently on different computers due to different screen resolution.
3. The browser's back button might not work as the user hopes.
4. There are still few browsers that do not support frame technology.

CREATING FRAMES

To use frames on a page we use <frameset> tag instead of <body> tag. The <frameset> tag defines, how to divide the
window into frames. The rows attribute of <frameset> tag defines horizontal frames and cols attribute defines vertical frames. Each
frame is indicated by <frame> tag and it defines which HTML document shall open into the frame.

Example:

To create three horizontal frames:

<!DOCTYPE html>

<html>

<frameset rows="25%,75%">

<frame name="top" src="firstframe.html" />

<frameset cols="25%,75%">

<frame name="main" src="secondframe.html" />

<frame name="bottom" src="thirdframe.html" />

</frameset>

</html>

<html>
<head>
<title>first</title>
</head>
<body>
<center>
<h1>HARI STATIONARY</h1>
</center>
</body>
</html>

<html>
<head>
<title>second</title>
</head>
<body>
<h3>For Contact:</h3>
<p>9712347644
<br>
9497964326
</p>
</body>
</html>

<html>
<head>
<title>third</title>
</head>
<body>
<h2>WELCOME TO HARI STATIONARY</h2>
</body>
</html>

Output:

THE <frameset> TAG ATTRIBUTE

ATTRIBUTE DESCRIPTION

Cols Specifies how many columns are contained in the frameset and the size of each
column. You can specify the width of each column in one of the four ways: Absolute
values in pixels. For example, to create three vertical frames, use cols="100, 500,100".
A percentage of the browser window. For example, to create three vertical frames, use
cols="10%, 80%,10%". Using a wildcard symbol. For example, to create three vertical
frames, use cols="10%, *,10%". In this case wildcard takes remainder of the window.
As relative widths of the browser window. For example, to create three vertical
frames, use cols="3*,2*,1*". This is an alternative to percentages. You can use
relative widths of the browser window. Here the window is divided into sixths: the
first column takes up half of the window, the second takes one third, and the third
takes one sixth.

Rows This attribute works just like the cols attribute and takes the same values, but it is used
to specify the rows in the frameset. For example, to create two horizontal frames, use
rows="10%, 90%". You can specify the height of each row in the same way as
explained above for columns.

Border This attribute specifies the width of the border of each frame in pixels. For example,
border="5". A value of zero means no border.

Frameborder This attribute specifies whether a three-dimensional border should be displayed


between frames. This attribute takes value either 1 (yes) or 0 (no). For example
frameborder="0" specifies no border.
THE <frame> TAG ATTRIBUTE

ATTRIBUTE DESCRIPTION

src This attribute is used to give the file name that should be loaded in the frame. Its value
can be any URL. For example, src="/html/top_frame.htm" will load an HTML file
available in html directory.

name This attribute allows you to give a name to a frame. It is used to indicate which frame
a document should be loaded into. This is especially important when you want to
create links in one frame that load pages into an another frame, in which case the
second frame needs a name to identify itself as the target of the link.

frameborder This attribute specifies whether or not the borders of that frame are shown; it overrides
the value given in the frameborder attribute on the <frameset> tag if one is given, and
this can take values either 1 (yes) or 0 (no).

margininwidth This attribute allows you to specify the width of the space between the left and right of
the frame's borders and the frame's content. The value is given in pixels. For example
marginwidth="10".

marginheight This attribute allows you to specify the height of the space between the top and bottom
of the frame's borders and its contents. The value is given in pixels. For example
marginheight="10".

noresize By default, you can resize any frame by clicking and dragging on the borders of a
frame. The noresize attribute prevents a user from being able to resize the frame. For
example noresize="noresize".

scrolling This attribute controls the appearance of the scrollbars that appear on the frame. This
takes values either "yes", "no" or "auto". For example scrolling="no" means it should
not have scroll bars.

longdesc This attribute allows you to provide a link to another page containing a long
description of the contents of the frame. For example
longdesc="framedescription.htm"

Browser Support for Frames:

If a user is using any old browser or any browser, which does not support frames then <no frames> element should be
displayed to the user. So you must place a <body> element inside the <no frames> element because the <frameset> element is
supposed to replace the <body> element, but if a browser does not understand <frameset> element then it should understand what
is inside the <body>element which is contained in a <noframes> element.

HTML <iframe> TAG

You can define an inline frame with HTML tag <iframe>. The <iframe> tag is not somehow related to <frameset> tag,
instead, it can appear anywhere in your document. The <iframe> tag defines a rectangular region within the document in which the
browser can display a separate document, including scrollbars and borders.
The src attribute is used to specify the URL of the document that occupies the inline frame.

Example:

<!DOCTYPE html>
<html>
<head>
<title> Iframes</title>
</head>
<body>
<p> Document content goes here… </p>
<iframe src = “/html /menu.htm” width = “555” height = “200”
Sorry your browser support inline frames.
<iframe>
<p> Document content also goes here.. </p>
</body>
</html>

Output:

Document content goes here... Document content can also go here...

THE <iframe> TAG ATTRIBUTE

Most of the attributes of the <iframe> tag, including name, class, frameborder, id, longdesc, marginheight, marginwidth,
name, scrolling, style, and title behave exactly like the corresponding attributes for the tag.

ATTRIBUTE DESCRIPTION

src This attribute is used to give the file name that should be loaded in the frame. Its value
can be any URL. For example, 16. HTML – IFRAMES HTML 87
src="/html/top_frame.htm" will load an HTML file available in html directory.

Name This attribute allows you to give a name to a frame. It is used to indicate which frame a
document should be loaded into. This is especially important when you want to create
links in one frame that load pages into an another frame, in which case the second
frame needs a name to identify itself as the target of the link.

Frameborder This attribute specifies whether or not the borders of that frame are shown; it overrides
the value given in the frameborder attribute on the <frame> tag if one is given, and this
can take values either 1 (yes) or 0 (no).

Marginwidth This attribute allows you to specify the width of the space between the left and right of
the frame's borders and the frame's content. The value is given in pixels. For example
marginwidth="10".

Margin height This attribute allows you to specify the height of the space between the top and bottom
of the frame's borders and its contents. The value is given in pixels. For example
marginheight="10".

Noresize By default, you can resize any frame by clicking and dragging on the borders of a
frame. The noresize attribute prevents a user from being able to resize the frame. For
example noresize="noresize".

Scrolling This attribute controls the appearance of the scrollbars that appear on the frame. This
takes values either "yes", "no" or "auto". For example scrolling="no" means it should
not have scroll bars.

longdesc This attribute allows you to provide a link to another page containing a long
description of the contents of the frame. For example
longdesc="framedescription.htm"
16. HTML - LISTS

HTML offers web authors three ways for specifying lists of information. All lists must contain one or more list elements.
Lists may contain −

<ul> − An unordered list. This will list items using plain bullets.

<ol> − An ordered list. This will use different schemes of numbers to list your items.

<dl> − A definition list. This arranges your items in the same way as they are arranged in a dictionary.

HTML UNORDERED LISTS

An unordered list is a collection of related items that have no special order or sequence. This list is created by using
HTML <ul> tag. Each item in the list is marked with a bullet.

Example :

<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>

Output :
 Coffee
 Tea
 Milk
THE type ATTRIBUTE

You can use type attribute for <ul> tag to specify the type of bullet you like. By default, it is a disc. Following are the
possible options −

<ul type = "square">


<ul type = "disc">
<ul type = "circle">

Example :

Disc:

<ul style="list-style-type:disc;">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>

Output :

 Coffee
 Tea
 Milk
Circle:
<ul style="list-style-type:circle;">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>

Output:

o Coffee
o Tea
o Milk

Square :

<ul style="list-style-type:square;">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>

Output :

 Coffee
 Tea
 Milk

HTML ORDERED LISTS

THE type ATTRIBUTE

You can use type attribute for <ol> tag to specify the type of numbering you like. By default, it is a number. Following are
the possible options −

<ol type = "1"> - Default-Case Numerals.


<ol type = "I"> - Upper-Case Numerals.
<ol type = "i"> - Lower-Case Numerals.
<ol type = "A"> - Upper-Case Letters.
<ol type = "a"> - Lower-Case Letters.

Example:

Default-Case Numerals:

<ol type = "1">

<ol type="1">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol

Output:
1. Coffee
2. Tea
3. Milk
Upper-Case Numerals:

<ol type = "I”>

<ol type="I">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>

Output :
I. Coffee
II. Tea
III. Milk

Lower-Case Numerals:
<ol type = “i">

<ol type="i">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>

Output:

i. Coffee
ii. Tea
iii. Milk

Upper-Case Letters:

<ol type = "A”>

<ol type="A">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
Output:

A. Coffee
B. Tea
C. Milk

Lower-Case Letters:

<ol type = "a”>

<ol type="a">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol
<ol type = "I”>
Output:
a. Coffee
b. Tea
c. Milk

HTML DEFINITION LISTS

HTML and XHTML supports a list style which is called definition lists where entries are listed like in a dictionary or
encyclopedia. The definition list is the ideal way to present a glossary, list of terms, or other name/value list.

Definition List makes use of following three tags.

<dl> − Defines the start of the list

<dt> − A term

<dd> − Term definition

</dl> − Defines the end of the list

Example:

<dl>
<dt><b>HTML</b></dt>
<dd>This stands for Hyper Text Markup Language</dd>
<dt><b>HTTP</b></dt>
<dd>This stands for Hyper Text Transfer Protocol</dd>
</dl>

Output:

HTML
This stands for Hyper Text Markup Language
HTTP
This stands for Hyper Text Transfer Protocol

MULTIPLE CHOICE QUESTIONS

1 .which inline function embeds independent HTML document into current document?

A) <div>
B) <span>
C) <iframe>
D) <from >
2.Which frame following is not a type of screen frames on HTML?

A)Iframe
B) no frame
C) Frameset
D) Uframe
3.what is use of iframe in HTML?

A) To display a webpage within a webpage


B) To display a web page with animation effects
C) To display a web page without browser
D) All of the above

4. An Unorded list in HTML documents starts with a?

A) <ul>tag
B) <li>tag
C) <lu>tag
D) None

5. what tag is used to list individual items of an order list?

A) LI
B) OL
C) UL
D) None of the above

6. HTML <dl>tag defines the

A) Unorded list
B) Order list
C) Description list
D) Descriptive list

7. How can you make a numbered list?

A) <dl>
B) <ol>
C) <ul>
D) <list>

8. <UL>…<UL>tag is used to?

A) Display the numbered list


B) Under line the next
C) Display the bulleted
D) Bold the text

6 MARK QUESTION

1. What is the purpose of <frame> tag in HTML?

12 MARK QUESTION

1.What are the different types of List controls? Explain them briefly.
17. HTML - LAYOUTS

 HTML layouts provide a way to arrange web pages in well-mannered,


 well-structured, and in responsive form or we can say that HTML layout
 specifies a way in which the web pages can be arranged.
 Web-page layout works with arrangement of visual elements of an HTML document.
 Web page layout is the most important part to keep in mind while creating a website so that our website can appear
professional with the great look.
 You can also use CSS and JAVASCRIPT based frameworks for creating layouts for responsive and dynamic website
designing.

Following are different HTML5 elements which are used to define the different parts of a webpage.

 <header> : It is used to define a header for a document or a section.


 <nav> : It is used to define a container for navigation links
 <section> : It is used to define a section in a document
 <article> : It is used to define an independent self-contained article
 <aside> : It is used to define content aside from the content (like a sidebar)
 <footer> : It is used to define a footer for a document or a section
 <details> : It is used to define additional details
 <summary> : It is used to define a heading for the <details> element

HTML <header>

The <header> element is used to create header section of web pages. The header contains the introductory content, heading
element, logo or icon for the webpage, and authorship information.

Example:

<!DOCTYPE html>
<html>
<head>
<title>First Webpage</title>
</head>
<body>
<header style=”background-color: #303030; height: 80px;width: 100%”>
<h1 style=”font-size: 30px; color: white;text-align: center; padding-top: 15px;”>Welcome to MyWebpage</h1>
</header>
</body>
</html>

Output:

HTML <nav>

The <nav> elements is a container for the main block of navigation links. It can contain links for the same page or for other
pages.

Example:

<!DOCTYPE html>
<html>
<head>
<style>
li{ display: inline-block;
padding: 10px}
</style>
</head>
<body>
<nav style="background-color:#bcdeef;">
<h1 style="text-align: center;">Navgation Links</h1>
<ul>
<li><a href="#">link1</a></li>
<li><a href="#">link2</a></li>
<li><a href="#">link3</a></li>
<li><a href="#">link4</a></li>
</ul>
</nav>
</body>
</html>

Output:

HTML <section>

HTML <section> elements represent a separate section of a web page which contains related element grouped together. It
can contain: text, images, tables, videos, etc.
Example:

<!DOCTYPE html>
<html>
<head>
<title>Page Section</title>
</head>
<body>
<section style=”background-color:#ff7f50; width: 100%; border: 1px solid black;”>
<h2>Introduction to JAVA</h2>
<p>Java is one of the most popular programming languages out there. Released in 1995 and still widely used today, Java has
many applications, including software development, mobile applications, and large systems development. Knowing Java opens a
lot of possibilities for you as a developer.</p>
</section>
</body>
</html>

Output:

HTML <article>

Tag is used to contain a self-contained article such as big story, huge article, etc.

Example:

<!DOCTYPE html>
<html>
<head>
<title>Article Example</title>
</head>
<body>
<article style=”width: 100%; border:2px solid black; background-color: #fff0f5;”>
<h2>History of Computer</h2>
<p>Write your content here for the history of computer</p>
</article>
</body>
</html>

Output:
HTML <aside>

HTML <aside> define aside content related to primary content. The <aside> content must be related to the primary content.
It can function as side bar for the main content of web page.

Example:

<!DOCTYPE html>
<html>
<head>
<title>Aside Example</title>
</head>
<body>
<aside style=”background-color:#e6e6fa”>
<h2>Sidebar information</h2>
<p>This conatins information which will represent like a side bar for a webpage</p>
</aside>
</body>
</html>

Output:

HTML <footer>

HTML <footer> element defines the footer for that document or web page. It mostly contains information about author,
copyright, other links, etc.

Example:

<!DOCTYPE html>
<html>
<head>
<title>Footer Section</title>
</head>
<body>
<footer style=”background-color:#f0f8ff; width: 100%; text-align: center;”>
<h3>Footer Example</h3>
<p>© Copyright 2018-2020. </p>
</footer>
</body>
</html>

Output:
HTML <details>

HTML <details> element is used to add extra details about the web page and use can hide or show the details as per
requirement.

Example:

<!DOCTYPE html>
<html>
<head>
<title>Details element</title>
</head>
<body>
<details style=”background-color: #f5deb3”>
<summary>This is visible section: click to show other details</summary>
<p>This section only shows if user want to see it. </p>
</details>
</body>
</html>

Output:

HTML <summary>

HTML <summary> element is used with the <details> element in a web page. It is used as summary, captions about the
content of <details> element.

Example:

<!DOCTYPE html>
<html>
<head>
<title>Summary Example</title>
</head>
<body>
<details>
<summary>HTML is acronym for?</summary>
<p style=”color: blue; font-size: 20px;”>Hypertext Markup Language</p>
</details>
</body>
</html>

Output:
18. HTML - COLORS

COLOR NAMES

In HTML, a color can be specified by using a color name.

 Tomato
 Orange
 DodgerBlue
 MediumSeaGreen
 Gray
 SlateBlue
 Violet
 LightGray

BACKGROUND COLOR

You can set the background color for HTML elements.

Example:

<!DOCTYPE html>
<html>
<body>

<h1 style=”background-color:light pink;”>Hello World</h1>

<p style=”background-color:grey;”>
English mathematician Charles Babbage conceives of a steam-driven calculating machine that would be able to compute tables of
numbers. The project, funded by the English government, is a failure. More than a century later, however, the world’s first
computer was actually built
</p>

</body>
</html>

TEXT COLOR

You can set the color of text.

Example:

<!DOCTYPE html>
<html>
<body><!D<!DOCTYPEOCTYPE html>
<html>
<body>

<h3 style="color:light pink;">Hello World</h3>

<p style="color:DodgerBlue;">: In France, Joseph Marie Jacquard invents a loom that uses punched
wooden cards to automatically weave fabric designs. Early computers would use similar punch card</p>

<p style="color:MediumSeaGreen;">Herman Hollerith designs a punch card system to calculate the 1880
census, accomplishing the task in just three years and
saving the government $5 million. He establishes a company that would ultimately become IBM..</p>

</body>
</html>
Output:

COLOR VALUES

In HTML, colors can also be specified using RGB values, HEX values, HSL values, RGBA values, and HSLA values.

The following three <div> elements have their background color set with RGB, HEX, and HSL values:

Rgb(255, 99, 71)


#ff6347
Hsl(9, 100%, 64%)

Example:

<!DOCTYPE html>
<html>
<body>

<h1 style=”border: 2px solid Tomato;”>Deepika</h1>

<h1 style=”border: 2px solid pink;”>Deepika</h1>

<h1 style=”border: 2px solid blue;”>Deepika</h1>

</body>
</html>

Output:

BORDER COLOR

You can set the color of borders.

Example:

<!DOCTYPE html>
<html>
<body>

<p>Same as color name “Tomato”:</p>


<h1 style=”background-color:rgb(255, 99, 71);”>rgb(255, 99, 71)</h1>
<h1 style=”background-color:#ff6347;”>#ff6347</h1>
<h1 style=”background-color:hsl(9, 100%, 64%);”>hsl(9, 100%, 64%)</h1>

<p>Same as color name “Tomato”, but 50% transparent:</p>


<h1 style=”background-color:rgba(255, 99, 71, 0.5);”>rgba(255, 99, 71, 0.5)</h1>
<h1 style=”background-color:hsla(9, 100%, 64%, 0.5);”>hsla(9, 100%, 64%, 0.5)</h1>

<p>In addition to the predefined color names, colors can be specified using RGB, HEX, HSL, or even transparent colors using
RGBA or HSLA color values.</p>

</body>
</html>

Output:

MULTIPLE CHOICE QUESTIONS

1) Which one of the following contains information about the author?

a) <footer>
b) <header>
c) <head>
d) <body>

2) Which element contains major navigational block?

a) <nav>
b) <address>
c) <footer>
d) <header>

3) Which element represents self-contained composition in document?

a) <nav>
b) <header>
c) <footer>
d) <article>

4) Which element groups related content together?

a) <aside>
b) <footer>
c) <section>
d) <div>
5) What is the HTML code for adding a background color?

a)<body style= “background-color:red;”>


b)<background>red</background>
c)<bg>red</bg>
d)None of the above

6) Which amongst the following tags is used to specify important texts in HTML?

a)<b>
b)<important>
c)<imptext>
d)<strong>

7) In HTML, each parameter in RGB(red, green, blue) defines intensity of color between?

a)0 – 90
b)0 – 255
c)0-65536
d)0 – infinity

8) In HTML you can display a color by using only

a) Values
b)HEX Values
c) Codes
d) A and B

6 MARK QUESTION

1. Explain about Colors in HTML.

12 MARK QUESTION

1. Describe About Types of Layouts with Example.


19. HTML - FORMS

HTML Forms are required, when you want to collect some data from the site visitor. For example,
during user registration you would like to collect information such as name, email address, credit
card, etc.

A form will take input from the site visitor and then will post it to a back-end application such as
CGI, ASP Script or PHP script etc. The back-end application will perform required processing on
the passed data based on defined business logic inside the application.

There are various form elements available like text fields, textarea fields, drop-down menus, radio
buttons, checkboxes, etc.

SYNTAX FOR <form> TAG

The HTML <form> tag is used to create an HTML form and it has following syntax:

<form action=”Script URL”method=”GET|POST”>


Form elements like input,textarea etc.
</form>

FORM ATTRIBUTES

Following is a list of the most frequently used form attributes:

● action - Backend script ready to process your passed data.


● method - Method to be used to upload data. The most frequently used are GET and POST methods.
● target - Specify the target window or frame where the result of the script will be displayed. It takes values like _blank, _self,
_parent etc.
● enctype - You can use the enctype attribute to specify how the browser encodes the data before it sends it to the server.
Possible values are:
○ application/x-www-form-urlencoded - This is the standard method most forms use in simple scenarios.
○ mutlipart/form-data - This is used when you want to upload binary data in the form of files like image, word file etc.

HTML FORM CONTROLS

There are different types of form controls that you can use to collect data using HTML form:

1. Text Input Controls


2. Checkboxes Controls
3. Radio Box Controls
4. Select Box Controls
5. File Select boxes
6. Hidden Controls
7. Clickable Buttons
8. Submit and Reset Button

1. TEXT INPUT CONTROLS

There are three types of text input used on forms:

● Single-line text input controls


● Password input controls
● Multi-line text input controls

Single-line text input controls:

This control is used for items that require only one line of user input, such as search boxes or names. They are created using
HTML <input> tag.

Example:

<form >
First name: <input type="text" name="first_name" />
<br>
Last name: <input type="text" name="last_name" />
</form>

Output:

ATTRIBUTES

Following is the list of attributes for <input> tag for creating text field.

● type - Indicates the type of input control and for text input control it will be set to text.
● name - Used to give a name to the control which is sent to the server to be recognized and get the value.
● value - This can be used to provide an initial value inside the control.
● size - Allows to specify the width of the text-input control in terms of characters.
● maxlength - Allows to specify the maximum number of characters a user can enter into the text box.

Password Input controls:

This is also a single-line text input but it masks the character as soon as a user enters it. They are also created using HTML
<input> tag but type attribute is set to password.

Example:

<form >
User ID : <input type="text" name="user_id" />
<br>
Password: <input type="password" name="password" />
</form>

Output:

ATTRIBUTES

Following is the list of attributes for <input> tag for creating password field.

● type - Indicates the type of input control and for password input control it will be set to password.
● name - Used to give a name to the control which is sent to the server to be recognized and get the value.
● value - This can be used to provide an initial value inside the control.
● size - Allows to specify the width of the text-input control in terms of characters.
maxlength - Allows to specify the maximum number of characters a user can enter into the text box.

Multiple-Line Text Input Controls:

This is used when the user is required to give details that may be longer than a single sentence. Multi-line input controls are
created using HTML <textarea> tag.

Example:

<form>
Description: <br />
<textarea rows="5" cols="50" name="description">
Enter description here...
</textarea>
</form>
Output:

ATTRIBUTES

Following is the list of attributes for <textarea> tag.

● name - Used to give a name to the control which is sent to the server to be recognized and get the value.
● rows - Indicates the number of rows of text area box.
● cols - Indicates the number of columns of text area box

2. CHECKBOX CONTROL

Checkboxes are used when more than one option is required to be selected. They are also created using HTML <input> tag
but type attribute is set to checkbox.

Example:

<form>
<input type="checkbox" name="red" value="on"> Red
<input type="checkbox" name="blue" value="on"> Blue
</form>

Output:

ATTRIBUTES

Following is the list of attributes for <checkbox> tag.

● type - Indicates the type of input control and for checkbox input control it will be set to checkbox.
● name - Used to give a name to the control which is sent to the server to be recognized and get the value.
● value - The value that will be used if the checkbox is selected.
● checked - Set to checked if you want to select it by default.

3. RADIO BUTTON CONTROLS

Radio buttons are used when out of many options, just one option is required to be selected. They are also created using
HTML <input> tag but type attribute is set to radio.

Example:

<form>
<input type="radio" name="color" value="red"> Red
<input type="radio" name="color" value="blue"> Blue
</form>

Output:
ATTRIBUTES

Following is the list of attributes for radio button.

● type - Indicates the type of input control and for checkbox input control it will be set to radio.
● name - Used to give a name to the control which is sent to the server to be recognized and get the value.
● value - The value that will be used if the radio box is selected.
● checked - Set to checked if you want to select it by default.

4. SELECT BOX CONTROL

A select box, also called drop down box which provides option to list down various options in the form of drop down list,
from where a user can select one or more options.

Example:

<form>
<select name="dropdown">
<option value="School">School</option>
<option value="College” selected</option>
</select>
</form>

Output:

ATTRIBUTES

Following is the list of important attributes of <select> tag:

● name - Used to give a name to the control which is sent to the server to be recognized and get the value.
● size - This can be used to present a scrolling list box.
● multiple - If set to "multiple" then allows a user to select multiple items from the menu.

Following is the list of important attributes of <option> tag:

● value - The value that will be used if an option in the select box box is selected.
● selected - Specifies that this option should be the initially selected value when the page loads.
● label - An alternative way of labeling options

5. FILE UPLOAD BOX

If you want to allow a user to upload a file to your web site, you will need to use a file upload box, also known as a file
select box. This is also created using the <input> element but type attribute is set to file.

Example:

<form>
<input type="file" name="fileupload" accept="image/*" />
</form>

Output:
ATTRIBUTES

Following is the list of important attributes of file upload box:


● name - Used to give a name to the control which is sent to the server to be recognized and get the value.
● accept - Specifies the types of files that the server accepts.

6. BUTTON CONTROLS

There are various ways in HTML to create clickable buttons. You can also create a clickable button using <input> tag by
setting its type attribute to button.

The type attribute can take the following values:

● submit - This creates a button that automatically submits a form.


● reset - This creates a button that automatically resets form controls to their initial values.
● button - This creates a button that is used to trigger a client-side script when the user clicks that button.
● image - This creates a clickable button but we can use an image as background of the button.

Example:

<form>
<input type="submit" name="submit" value="Submit" />
<input type="reset" name="reset" value="Reset" />
<input type="button" name="ok" value="OK" />
<input type="image" name="imagebutton" src="/html/images/logo.png" />
</form>

Output:

7. HIDDEN FORM CONTROLS

Hidden form controls are used to hide data inside the page which later on can be pushed to the server. This control hides
inside the code and does not appear on the actual page. For example, following hidden form is being used to keep current page
number. When a user will click next page then the value of hidden control will be sent to the web server and there it will decide
which page will be displayed next based on the passed current page.

Example:

<form>
<p>This is page 10</p>
<input type="hidden" name="pagename" value="10" />
<input type="submit" name="submit" value="Submit" />
<input type="reset" name="reset" value="Reset" />
</form>

Output:
20. HTML - BACKGROUNDS

HTML provides the following two ways to decorate webpage background.They are:
● Html Background with Colors
● Html Background with Images

HTML BACKGROUND WITH COLORS

The bgcolor attribute is used to control the background of an HTML element, specifically page body and table backgrounds.

SYNTAX

<tagname bgcolor=”color_value”…>

Example:

<body style="background-color:powderblue;">
<h1>HTML background color </h1>
<p>This is a skyblue .</p>
</body>

Output:

HTML BACKGROUND WITH IMAGES

The background attribute can also be used to control the background of an HTML element, specifically page body and table
backgrounds. You can specify an image to set background of your HTML page or table.

SYNTAX

<tagname background=”Image URL”…>

Example:

<style>
body {
background-image: url('img_girl.jpg');
}
</style>
</head>
<body>
<h2>Background Image</h2>
</body>
Output:

PATTERNED & TRANSPARENT BACKGROUNDS

This simply can be achieved by using patterned image or transparent image in the background. It is suggested that while
creating patterns or transparent GIF or PNG images, use the smallest dimensions possible even as small as 1x1 to avoid slow
loading.

Example:

<!-- Set a table background using pattern -->


<table background="/images/pattern1.gif" width="100%" height="100">
<tr><td>
This background is filled up with a pattern image.
</td></tr>
</table>
<!-- Another example on table background using pattern -->
<table background="/images/pattern2.gif" width="100%" height="100">
<tr><td>
This background is filled up with a pattern image.

Output:

MULTIPLE CHOICE QUESTIONS

1. There are ____ types of text input used on forms.

a) two
b) three
c)four
d) five

2. Which control is used for items that require only one line of user input, such as search boxes or names?

a)Password input controls


b)Multi-line text input controls
c)Single-line text input controls
d)Select Box Controls
3. _______ are created using HTML <textarea> tag.

a)Multi-line input controls


b)Password input controls
c)Radio button controls
d)Single-line text input controls

4. ______ are used when more than one option is required to be selected.

a)Radiobuttons
b)Checkboxes
c)Selectbox
d)File upload box

5. ____ control hides inside the code and does not appear on the actual page.

a)Button Controls
b)Radio button controls
c) Checkbox Controls
d)Hidden Form Controls

6. HTML provides ___ ways to decorate the webpage background.

a)two
b)three
c)four
d)five

7. ____ attribute is used to set image background.

a)text
b)bgcolor
c)background
d)link

8. _____ attribute is used to set color at the page body and table background.

a)bgcolor
b)background
c)text
d)link

6 MARK QUESTION

1. How to set background color in HTML? Give an example using HTML code.

12 MARK QUESTION

1. What are the different types of form controls? Explain them briefly.
21. HTML - EMBED MULTIMEDIA

The easiest way to add video or sound to your web site is to include the special HTML tag called <embed>.This tag causes
the browser itself to include controls for the multimedia automatically provided browser supports <embed> tag and given media
type.You can also include a <noembed> tag for the browsers which don't recognize the <embed> tag.

THE <embed> TAG ATTRIBUTES

S.NO ATTRIBUTE & DESCRIPTION

1 align
Determines how to align the object. It can be set to either center, left or right.

2 autostart
This boolean attribute indicates if the media should start automatically. You can set it
either true or false.

3 loop
Specifies if the sound should be played continuously (set loop to true), a certain
number of times (a positive value) or not at all (false)

4 playcount
Specifies the number of times to play the sound. This is alternate option for loop if you
are usiong IE.

5 hidden
Specifies if the multimedia object should be shown on the page. A false value means
no and true values means yes.

6 width
Width of the object in pixels

7 height
Height of the object in pixels

8 name
A name used to reference the object.

9 src
URL of the object to be embedded.

10 volume
Controls volume of the sound. Can be from 0 (off) to 100 (full volume).
Example:

Embed pdf into an HTML Document.

<html>
<body>
<title>Embeded PDF</title>
<embed type = "application/pdf" src = "PL SQL.pdf" width=100% height=700px>
</embed>
</body>
</html>

Output:

BACKGROUND AUDIO

You can use HTML <bgsound> tag to play a soundtrack in the background of your webpage. This tag is supported by
Internet Explorer only and most of the other browsers ignore this tag. It downloads and plays an audio file when the host document
is first downloaded by the user and displayed. The background sound file also will replay whenever the user refreshes the
browser.This tag is having only two attributes loop and src.

This will produce the blank screen. This tag does not display any component and remains hidden.Internet Explorer can also
handle only three different sound format files − wav, the native format for PCs; au, the native format for most Unix workstations;
and MIDI, a universal music-encoding scheme.

Example:

<html>
<head>
<title>HTML audio controls</title>
</head>
<body>
<bgsound src = "levitating.mid">
</bgsound>
Internet Explorer support this audio element.
</body>
</html>
Output:

levitating.mid

MULTIMEDIA FORMATS

Multimedia elements (like audio or video) are stored in media files.The most common way to discover the type of a file, is to
look at the file extension.Multimedia files have formats and different extensions like: .wav, .mp3, .mp4, .mpg, .wmv, and .avi.

HTML AUDIO

HTML <audio> ELEMENT

The HTML <audio> element is used to play an audio file on a web page.

The controls attribute adds audio controls, like play, pause, and volume.

The <source> element allows you to specify alternative audio files which the browser may choose from. The browser will
use the first recognized format.

The text between the <audio> and </audio> tags will only be displayed in browsers that do not support the <audio> element.

COMMON AUDIO FORMATS

MP3 is the best format for compressed recorded music. The term MP3 has become synonymous with digital music.If your
website is about recorded music, MP3 is the choice.

FORMAT FILE DESCRIPTION

MIDI .mid MIDI (Musical Instrument Digital Interface). Main format for all electronic
.midi music devices like synthesizers and PC sound cards. MIDI files do not
contain sound, but digital notes that can be played by electronics. Plays
well on all computers and music hardware, but not in web browsers.

RealAudio .rm RealAudio. Developed by Real Media to allow streaming of audio with
.ram low bandwidths. Does not play in web browsers.

WMA .wma WMA (Windows Media Audio). Developed by Microsoft. Plays well on
Windows computers, but not in web browsers.

AAC .aac AAC (Advanced Audio Coding). Developed by Apple as the default format
for iTunes. Plays well on Apple computers, but not in web browsers.

WAV .wav WAV. Developed by IBM and Microsoft. Plays well on Windows,
Macintosh, and Linux operating systems. Supported by HTML.
Ogg .ogg Ogg. Developed by the Xiph.Org Foundation. Supported by HTML.

MP3 .mp3 MP3 files are actually the sound part of MPEG files. MP3 is the most
popular format for music players. Combines good compression (small
files) with high quality. Supported by all browsers.

NOTE: Only MP3,WAV and Ogg audio are supported by the HTML Standard.

Chromium browsers do not allow autoplay in most cases. However, muted autoplay is always allowed.

Example using MP3 Format:

<html>
<title>HTML audio controls</title>
<body>
<audio controls>
<source src = “Levitating.mp3” type = “audio/mpeg”>
Your browser does not support this audio element.
</audio>
</body>
</html>

Output:

Levitating.mp3

Example using WAV Format:

<html>
<title>HTML audio muted</title>
<body>
<audio muted controls>
<source src = “Alone.wav” type = “audio/wav”>
Your browser does not support this audio element.
</audio>
</body>
</html>
Output:

Alone.wav

Example using OGG Format:

<html>
<title>HTML audio controls</title>
<body>
<audio controls>
<source src = “Child’s Nightmare.ogg” type = “audio/ogg”>
Your browser does not support this audio element.
</audio>
</body>
</html>

Output:

Child's
Nightmare.ogg

HTML VIDEO

HTML <video> ELEMENT

The HTML <video> element is used to show a video on a web page.

The controls attribute adds video controls, like play, pause, and volume.

We can also include width and height attributes. If height and width are not set, the page might flicker while the video loads.

The <source> element allows you to specify alternative video files which the browser may choose from. The browser will
use the first recognized format.
The text between the <video> and </video> tags will only be displayed in browsers that do not support the <video> element.
COMMON VIDEO FORMATS

There are many video formats out there.The MP4, WebM, and Ogg formats are supported by HTML.
The MP4 format is recommended by YouTube.

FORMAT FILE DESCRIPTION

MPEG .mpg MPEG. Developed by the Moving Pictures Expert Group. The first popular
.mpeg video format on the web. Not supported anymore in HTML.

AVI .avi AVI (Audio Video Interleave). Developed by Microsoft. Commonly used
in video cameras and TV hardware. Plays well on Windows computers, but
not in web browsers.

WMV .wmv WMV (Windows Media Video). Developed by Microsoft. Commonly used
in video cameras and TV hardware. Plays well on Windows computers, but
not in web browsers.

QuickTime .mov QuickTime. Developed by Apple. Commonly used in video cameras and
TV hardware. Plays well on Apple computers, but not in web browsers.

RealVideo .rm RealVideo. Developed by Real Media to allow video streaming with low
.ram bandwidths. Does not play in web browsers.

Ogg .ogg Theora Ogg. Developed by the Xiph.Org Foundation. Supported by


HTML.

WebM .webm WebM. Developed by Mozilla, Opera, Adobe, and Google. Supported by
HTML.

MPEG-4 .mp4 MP4. Developed by the Moving Pictures Expert Group. Commonly used in
or MP4 video cameras and TV hardware. Supported by all browsers
and recommended by YouTube.

NOTE: Only MP4, WebM and Ogg video are supported by the HTML Standard.

Chromium browsers do not allow autoplay in most cases. However, muted autoplay is always allowed.

Example using MP4 Format:

<html>
<title>HTML video controls</title>
<body>
<video width = “500” height = “340” controls>
<source src = “Oggy.mp4” type = “audio/mp4”>
Your browser does not support this video element.
</video>
</body>
</html>
Output:

Oggy.mp4

Example using MP4 Format:

<html>
<title>HTML video muted</title>
<body>
<video width = “400” height = “220” muted controls>
<source src = “Oggy.mp4” type = “audio/mp4”>
Your browser does not support this video element.
</video>
</body>
</html>

Output:

Oggy.mp4

HTML OBJECT TAG

The <object> element defines an embedded object within an HTML document. It was designed to embed plug-ins (like Java
applets, PDF readers, and Flash Players) in web pages, but can also be used to include HTML in HTML.The <object> element is
supported by all browsers.
Example:

Adding an HTML document in an HTML document:

<html>

<body>

<object width="100%" height="500px" data="Lists.html"></object>

</body>

</html>

Output:

Example:

Adding an image in an HTML document:

<html>

<body>

<object data="Ed.jpg"></object>

</body>

</html>
Output:
22. HTML - STYLES

Cascading Style Sheets (CSS) provide easy and effective alternatives to specify various attributes for the HTML tags. Using
CSS, you can specify a number of style properties for a given HTML element. Each property has a name and a value, separated by
a colon (:). Each property declaration is separated by a semi-colon (;).

HTML STYLE ATTRIBUTE

Setting the style of an HTML element, can be done with the style attribute.

SYNTAX

<tagname style="property:value;">

The property is a CSS property. The value is a CSS value.

Example:

<html>
<head>
<title>HTML Styles</title>
</head>
<body>
<p style = "color:red; font-size:30px;" >Documents are presented on screen</p>
</body>
</html>

Output:

We can use CSS in three ways in your HTML document −


1. External Style Sheet − Define style sheet rules in a separate .css file and then include that file in your HTML document using
HTML <link> tag.
2. Internal Style Sheet − Define style sheet rules in header section of the HTML document using <style> tag.
3. Inline Style Sheet − Define style sheet rules directly along-with the HTML elements using style attribute.

1. EXTERNAL STYLE SHEET

If you need to use your style sheet to various pages, then its always recommended to define a common style sheet in a
separate file. A cascading style sheet file will have extension as .css and it will be included in HTML files using <link> tag.

Example:

CSS RULES

body
{background-color:teal;}
h1
{color: black;margin-left: 20px;}

We defined two CSS rules which will be applicable to two different classes defined for the HTML tags.
Now we can use the above external CSS file in our following HTML document.
HTML CODE

<html>
<head>
<title>HTML External styles</title>
<link rel = "stylesheet" type = "text/css" href = "sty.css">
</head>
<body>
<h1>Let it snow</h1>
<h4>Let it rain</h4>
</body>
</html>

Output:

2. INTERNAL STYLE SHEET

If you want to apply Style Sheet rules to a single document only, then you can include those rules in header section of the
HTML document using <style> tag.Rules defined in internal style sheet overrides the rules defined in an external CSS file.

Example:

<html>
<head>
<title>HTML Internal styles</title>
<style>
body
{background-color:tomato;}
h2
{color: black;margin-left: 30px;}
</style>
</head>
<body>
<h2>Let it snow</h2>
<p>Let it rain<p>
</body>
</html>
Output:

3. INLINE STYLE SHEET

An inline style may be used to apply a unique style for a single element.To use inline styles, add the style attribute to the
relevant element. The style attribute can contain any CSS property.

Example:

<html>

<body>

<h1 style="color:blue;text-align:center;">Let it snow</h1>

<p style="color:red;">Let it rain</p>

</body>

</html>

Output:
MULTIPLE CHOICE QUESTIONS

1. Which tag will be used incase of <embed> tag when it was not supported by browser?

a)<object>
b) <noembed>
c) <audio>
d) <applet>

2. Which attribute specifies the number of times to play the sound?

a) playcount
b) hidden
c) loop
d) align

3 . Which attribute identifies the version of java plug-in to use?

a) loop
b) classid
c) autostart
d) hidden

4. Which of the following file type is created by Macromedia's Flash program?

a) .mov
b) .wmv
c) .mpeg
d) .swf

5. How many attributes does background audio contains?

a) loop and src


b) width and height
c) controls and src
d) autoplay and muted

6. External style sheets are referred in web document through a

a) class
b) line/url or path
c) page
d) none

7. Which attribute is used to add video controls like play, pause, and volume in video?

a) <autoplay>
b) <play>
c) <video controls>
d) <controls>

8. Which style sheet file will have extension as .css?

a) cascading
b) cellpadding
c) cellspacing
d) style

6 MARK QUESTION

1) Explain <embed> tag attributes and background audio with example.

12 MARK QUESTION

1) Briefly explain HTML Styles with suitable examples.

You might also like