CS1 CHAPTER 4_New
CS1 CHAPTER 4_New
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. HTML elements tell the browser how to
display the content. HTML elements label pieces of content such as "this is a
heading", "this is a paragraph", "this is a link", etc. HTML helps to build structure of a
website and is a widely used Markup language. . It is easy to learn. Every browser
supports HTML Language. HTML is light weighted and fast to load. HTML is simple
to edit as being a plain text. It integrates easily with other languages such as
JavaScript, CSS etc. HTML also allows the utilization of templates, which makes
designing a webpage easy. It cannot produce dynamic output alone, since it’s a static
language. It is the time consuming as the time it consume to maintain on the colour
scheme of a page and to make lists, tables and forms. We need to write a lot of code
for just creating a simple webpage. Security features offered by HTML are limited.
HTML can create only static and plain pages so if we’d like dynamic pages then
HTML isn’t useful.
ADVANTAGES
DISADVANTAGES
1. HTML doesn’t offer programming languages features and capabilities.
2. It’s easy to write “bad” HTML containing errors.
3. Complex HTML code is hard to read and understand and code complexity increases
to make interactive web page. So building complex pages is very time consuming.
4. It’s easy to make mistakes (e.g. leaving out a “>” or “/” character).
5. Special types of software like scripting languages (VB Script, Java Script) are
required for handling different events and validations.
6. Can’t detect errors easily since no special debugging tool is provided.
HTML DOCUMENTATION
HTML documents are plaintext (also known as ASCII) filed that can be created
using any text editor (e.g., Emacs or vi on UNIX machines; Simple Text on a
macintosh; Notepad on a Windows machine). You can also use wordprocessing
software if you remember to save your document as “text only with line breaks”.
HTML Editors
HTML Editors are programming tools for Hyper Text Markup Language (HTML)
documents.
There are three categories of HTML Editors:
1. Text Editors
2. HTML Code Editors
3. HTML Design Tools
1. Text Editors
These editors only edit ASCII text. They offer no functionality to facilitate better
HTML development. They are useful if your knowledge of HTML is excellent.
Some examples of Text Editors include Notepad (Windows), Simple Text
(Macintosh), and Pico (Unix).
They are typically WYSIWYG. WYSIWYG is an acronym for “What you see is
what you get”; it means that you design your HTML document visually, as if you
were using a word processor, instead of writing the markup tags in a plaintext
file and imagining what the resulting page will look like.
(When you save an HTML file, you can use either the htm or the html extension.
Save the file as “firstpage.htm”. Open this file through your Internet browser.)
Example Explained
The first tag in your HTML document is <HTML>. This tag tells your browser that
this is the start of an HTML document. The last tag in your document is </HTML>.
This tag tells your browser that this is the end of the HTML document. The text
between the <HEAD> tag and the </HEAD> tag is header information. Header
information is not displayed in the browser window. The title is displayed in your
browser’s caption.
The text between the <BODY> tags is the text that will be displayed in your browser.
The text between the <TITLE> tags is the title of your page.
TITLE TAG
The <title> tag defines the title of the document. The title must be text-only, and it
is shown in the browser's title bar or in the page's tab.
The <title> tag is required in HTML documents!
The contents of a page title is very important for search engine optimization
(SEO)! The page title is used by search engine algorithms to decide the order
when listing pages in search results.
The <title> element:
defines a title in the browser toolbar
displays a title for the page in search-engine results
Syntax:
<TITLE>……</TITLE>
Example:
<!DOCTYPE html>
<html>
<head>
<title>HTML Elements Reference</title>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
2) BODY TAG
The <body> tag defines the document's body.
The <body> element contains all the contents of an HTML document, such as
headings, paragraphs, images, hyperlinks, tables, lists, etc.
There can only be one <body> element in an HTML document.
ATTRIBUTES IN BODY TAG
1) The BACKGROUND Attribute
This allows you to specify an image file to use as a background (a bit like a
watermark) behind the displayed text and graphics.
E.g.<BODY BACKGROUND=”c:\a.fig”>
Text …..
</BODY>
So image a.gif will be set as a background to your web page.
2) Background colour of the web page
Attribute is:BGCOLOR=”#rrggbb”
Sets the background colour to the specified RGB colour value, where RR GG
and BB are the hexadecimal colour codes for the Red, Green and Blue levels,
ranging from 0 to 255 that is, 00 to FF. The colour “000000” is black, while
“FFFFFF” is white.
3) Setting the text colour (TEXT Attribute)
Syntax: <BODY TEXT=”#rrggbb”> text in a body</BODY>
Sets the default text colour to the specified RGB colour value.
4) Setting colour for hyperlinks (LINK Attribute)
Syntax> <BODY LINK=“#rrggbb”>text in a body</BODY?
Sets the default text colour of hypertext anchors to the specified RGB colour
value.
5) Setting colour for visited hy[perlinks (VLINK Attribute)
Syntax: <BODY VLINK=“#rrggbb”>text in a body</BODU>
Sets the default text colour of visited hypertext links to the specified RGB colour
value.
Syntax:
<BODY>…….</BODY>
Example:
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
3) <P> TAG
The <p> tag defines a paragraph.
Browsers automatically add a single blank line before and after each <p> element.
Can contain align attribute for alignment of the text within the paragraph.
Eg:<P ALIGN=”CENTER”> this is a paragraph</P>
4) <BR> TAG
The <br> tag inserts a single line break.
The <br> tag is useful for writing addresses or poems.
The <br> tag is an empty tag which means that it has no end tag.
Syntax: <BR>
Example:
<!DOCTYPE html>
<html>
<body>
<h1>The br element</h1>
<p>To force<br> line breaks<br> in a text,<br> use the br<br> element.</p>
</body>
</html>
5) <HR> TAG
The <hr> tag defines a thematic break in an HTML page (e.g. a shift of topic).
The <hr> element is most often displayed as a horizontal rule that is used to separate
content (or define a change) in an HTML page.
Syntax: <HR>
Example:
<!DOCTYPE html>
<html>
<body>
<h1>The Main Languages of the Web</h1>
<p>HTML is the standard markup language for creating Web pages. </p>
<hr>
<p>CSS is a language that describes how HTML elements are to be displayed on
screen, paper, or in other media.</p>
<hr>
<p>JavaScript is the programming language of HTML and the Web.</p>
</body>
</html>
6) <!--..--> TAG
The comment tag is used to insert comments in the source code. Comments are not
displayed in the browsers.
You can use comments to explain your code, which can help you when you edit the
source code at a later date. This is especially useful if you have a lot of code.
Syntax:
<!-- this is a valid comment -->
< !-- this is a invalid comment -->
Example:
<!DOCTYPE html>
<html>
<body>
<!-- This is a comment -->
<p>This is a paragraph.</p>
<!-- Comments are not displayed in the browser -->
</body>
</html>
7) HEADING TAGS <H1>……<H6>
The <h1> to <h6> tags are used to define HTML headings.
<h1> defines the most important heading. <h6> defines the least important heading.
Syntax:
<H1>…..</H1>
<H2>…..</H2>
<H3>…..</H3>
<H4>…..</H4>
<H5>…..</H5>
<H6>…..</H6>
Example:
<!DOCTYPE html>
<html>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
</body>
</html>
8) <PRE> TAG
The <pre> tag defines preformatted text.
Text in a <pre> element is displayed in a fixed-width font, and the text preserves both
spaces and line breaks. The text will be displayed exactly as written in the HTML
source code.
Syntax:
<PRE>…..</PRE>
Example:
<!DOCTYPE html>
<html>
<body>
<h1>The pre element</h1>
<pre>
Text in a pre element is displayed in a fixed-width font, and it preserves both spaces and
line breaks
</pre>
</body>
</html>
1) FONT TAG
The <font> tag was used in HTML 4 to specify the font face, font size, and color of
text.
SYNTAX: <FONT>……</FONT>
Attribute Example Purpose
Size=“number” Size=“2” Defines the font
size
Size=“+number” Size=“+1” Increases the font
size
Size=“number” Size=“1” Decreases the font
size
Face=“facename” Face=“Times new Roman” Defines the
fontname
Color=“colorvalue” Color=“#eeff00 Defines the font
color
Color=“colorname” Color=“red” Defines the font
color
2) MARQUEE TAG
The Marquee HTML tag is a non-standard HTML element which is used to scroll a
image or text horizontally or vertically.
In simple words, you can say that it scrolls the image or text up, down, left or right
automatically.
Marquee tag was first introduced in early versions of Microsoft's Internet Explorer.
Syntax:
<MARQUEE>……</MARQUEE>
Example:
<!DOCTYPE html>
<html>
<body>
<marquee>This is an example of html marquee </marquee>
</body>
</html>
Marquee Attributes
Attribute Description
behavior It facilitates user to set the behavior of the marquee to one of the
three different types: scroll, slide and alternate.
direction defines direction for scrolling content. It may be left, right, up and
down.
width defines width of marquee in pixels or %.
height defines height of marquee in pixels or %.
hspace defines horizontal space in pixels around the marquee.
vspace defines vertical space in pixels around the marquee.
scrolldelay defines scroll delay in seconds.
scrollamount defines scroll amount in number.
loop defines loop for marquee content in number.
bgcolor defines background color.
3) CHARACTER FORMATTING
LOGICALS STYLES
<EM>
For emphasis. Typically displayed in italics. (Consultants cannot reset your password
unless you call the help line)
<CODE>
For computer code. Displayed in a fixedwidth font. (The <stdio.h> header file)
<STRONG>
For strong emphasis. Typically displayed in bod. (NOTE.: Always check your links.)
<VAR>
For a variable, where you will replace the variable with specific information. Typically
displayed in italics. (rm filename deletes the file.)
PHYSICAL STYLES:
BOLD TAG <B>:
HTML bold tag is represented by <b> tag.
HTML <b> tag is used to display the written text in bold format. It is strictly a
presentational element. If you want to show your text in bold letters and not have
real semantic meaning, then put it within <b>.......</b> tag.
Example:
<!DOCTYPE>
<html>
<body>
<p> Hello guys, <b>this is the method to write bold text.</b></p>
</body>
</html>
ITALIC TEXT <I>:
HTML <i> tag is used to represent Italics. The content within <i> tag usually
renders in italic type on the browser. It can be useful to represent some technical
terms, phrase, fictional character thoughts, etc. It starts with <I> tag and ends
with </I>.
Example:
<!DOCTYPE html>
<html>
<body>
<h2>Example of HTML i tag</h2>
<p>PROJECT <i>G20</i> </p>
</body>
</html>
6) SMALL TAG
The <small> tag defines smaller text
Syntax: <SMALL>……</SMALL>
Example:
<!DOCTYPE html>
<html>
<body>
<h1>The small element</h1>
<p>This is some normal text.</p>
<p><small>This is some smaller text.</small></p>
</body>
</html>
7) BIG TAG
The <big> tag was used in HTML 4 to define bigger text.
Syntax: <BIG>…..</BIG>
Example:
<!DOCTYPE html>
<html>
<head>
<body>
<p>This is a normal paragraph.</p>
<p><big>This is a bigger paragraph.</big></p>
</body>
</html>
URLS IN HTML
Hypertext Anchors
URL stands for Uniform Resource Locator, which may represent an address of
document on web or Internet or simply a path to a document in a specific directory.
The World Wide Web used Uniform Resource Locators (URLs) to specify the location
of files on other servers. A URL includes the type of resource being accessed (e.g,
Web, gopher, FTP), the address of the server, and the location of the file. The syntax
is:
Scheme://host. Domain [:port]/path/filename
HTML provides you to jump from a link to any document or image or any local or
WebPages by using special tag, called <a> i.e. Anchor tag.
Syntax is: <A HREF=“URL”>name or image which can be treated as link</A>
Thus anchor is a piece of text or some other object (e.g. image), which marks the
beginning and/or the end of a hypertext link. The <A> element is used to mark that
piece of text (or inline image), and to give its hyper textual relationship to other
documents. The text between the opening and closing tags, <A attributes> …text…
</A> can act as start or destination (or both)o of a link. The HREF attribute (Which is
actually optional) marks the anchor as the start of a link to another document or
resource (it could point, for example, to an image file), or to a particular place in
another document.
Syntax is:
<A HREF=“URL (absolute or relative path)”>anchor name </A>
An absolute or partial URL can specify the address of the referenced document:
e.g.
1) Link to a page on the World Wide Web.
<A HREF=http://www.yahoo.com>Enter your emailid</A>
The string ‘Enter your emailid’ is a hypertext lint to the website indicated by URL
specified
2) Link to an image by image as a link.
<A HREF=“image2.jpeg”><IMG SRC=”image1.gif”></A>
The image ‘image1.gif’ is a hypertext link to the image file located in the same
directory This will allow you to use a small icon that links the user to a larger version
of the same image.
3) Link to document located in different director
<A HREF=”d:\soft\a.html”>Click Here.</A>
Here by clicking on Click Here link, destination page will be displayed which is
specified in the path given.
4) Link to the same page (Links to a Particular Place in a Document)
<P><A HREF= “#samepage”>This is link to the same page. </A></P>
<A NAME=”samepage”><H2>Yes You are in the same page.</H2></A>
Particular places in an HTML document can be marked as specific destinations of
hypertext links via the NAME attribute. Links to Specific Sections
Anchors can also be used to move a reader to a particular section in a document
(either the same or a different document) rather than to the top, which is the default.
This type of an anchor is commonly called a named anchor because to create the
links, you insert HTML names within the document.
LISTS IN HTML
1) UNORDERED LIST
The <ul> tag defines an unordered list of items or bulleted list of items.
Use the <ul> tag together with the <li> tag to create unordered lists.
The list items are marked with bullets(typically small black circles).
To make an unnumbered list:
1) Start with an opening list <UL> tag. Enter the <LI> (list item) tag followed by the
individual item followed by </LI> tag.
2) End the entire list with </UL> tag.
You can specify the style type of unordered list i.e. circle, disk, square.
Example:
<!DOCTYPE html>
<html>
<body>
<h1>The ul element</h1>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
</body>
</html>
2) ORDERED LIST
The <ol> tag defines an ordered list. An ordered list can be numerical or alphabetical.
The <li> tag is used to define each list item.
The items in the list are marked with numbers.
To make a numbered list:
1) Start with an opening list <OL> tag. Enter the <LI> (list item) tag followed by the
individual item followed by </LI> tag.
2) End the entire list with </OL> tag.
You can specify the style of numbering the list items by giving the attribute in <OL>
tag and it can take values “I” for uppercase roman, “i” for lowercase roman, “A” for
uppercase letters, “a” for lowercase alpha numeric letters.
Example:
<!DOCTYPE html>
<html>
<body>
<h1>The ol element</h1>
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<ol type="I">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
</body>
</html>
Example 1:
<!DOCTYPE html>
<html>
<body>
<h1>An unordered list inside an ordered list</h1>
<ol>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
</li>
<li>Milk</li>
</ol>
</body>
</html>
Example 2:
<!DOCTYPE html>
<html>
<body>
<h1>A list inside another list</h1>
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
</li>
<li>Milk</li>
</ul>
</body>
</html>
Example 3:
<!DOCTYPE html>
<html>
<body>
<h1>A list in a list in a list</h1>
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea
<ul>
<li>China</li>
<li>Africa</li>
</ul>
</li>
</ul>
</li>
<li>Milk</li>
</ul>
</body>
</html>
TABLES IN HTML
The HTML tables allow web authors to arrange data like text, images, links, other tables,
etc. into rows and columns of cells.
The HTML tables are created using the <table> tag in which the <tr> tag is used to
create table rows and <td> tag is used to create data cells. The elements under <td> are
regular and left aligned by default.
TABLE ELEMENTS
Example 2:
<html>
<head>
<title> table </title>
</head>
<body bgcolor="orange">
<caption>Wind </caption>
<table border="2" cellpadding="10" cellsapcing="50">
<tr>
<th> City</th>
<th> High</th>
<th> Low</th>
</tr>
<tr>
<td>Mumbai</td>
<td> 33</td>
<td> 24</td>
</tr>
</table>
<br><hr>
<center>TABLE 2</center>
<br>
<caption> Result</caption>
<table border="2">
<tr>
<th rowspan="2">Sr.No. </th>
<th rowspan="2">Student<br> Name</th>
<th colspan="3">Marks Obtained </th>
<th rowspan="2">Total <br></th>
</tr>
<tr>
<td> Test1 </td>
<td>Test2 </td>
<td> Test3 </td>
</tr>
<td align="center">1</td>
<td>Maheshwari</td>
<td>150</td>
<td>100</td>
<td>100</td>
<td>350</td>
</tr>
<tr>
<td align="center">2</td>
<td>Ravi</td>
<td>120</td>
<td>100</td>
<td>100</td>
<td>320</td>
</tr>
</table>
</body>
</html>
IMAGES IN HTML
The IMG tag specifies an image to be displayed in an HTML document.
An image can be a plain image that simply appears on the page. An image can be
embedded in an <A HREF> tag so that the user can click it to open a URL. An image
can also be an image map, which has multiple clickable areas that each link to
different URLS. The HEIGHT and WIDTH attributes indicate the dimensions of the
image. If you specify these attributes, Navigator uses them to reserve a place for the
image on the page and continues loading any text and other page elements instead
of waiting for the image to load. Most Web browsers can display inline images (that
is, images next to text)
Images can be in the following types of formats:
GIF (Graphics Interchange Format)
JPEG (Joint Photographic Experts Group)
XPM (X PixMap)
XBM (X Bitmap)
Syntax
<IMG
SRC = “location”
ALT = “alterntiveText”
ALIGN=“alignment”
BORDER=“borderWidth”
HEIGHT= “height”
WIDTH= “width”
HSPACE=“horizMargin”
VSPACE=“vericalMargin”
>
The SRC attribute is compulsory
SRC= “location(URL)”
Specifies the URL of the image to be displayed in the document.
ALT=“alternativeText”
Specifies text to be displayed if the browser does not support the IMG tag or if
the user has suspended image loading in the browser.
ALIGN
Specifies the alignment of the image in relation to the surrounding text. If you do not
specify a value for ALIGN, browser uses BOTTOM as the default LEFT aligns an
image with the left margin.
RIGHT aligns an image with the right margin.
TOP aligns the top of an image with the top of the tallest item in the current line.
TEXTTOP aligns the top of an image with the top of the tallest text in the current
line.
MIDDLE aligns the middle of the image with the baseline of the text in the current
line.
BASELINE aligns the bottom of an image with the baseline of the text in the
current line.
BOTTOM is the same as BASELINE.
BORDER=“borderWidth”
Specifies the width, in pixels, of a border around the image. The value must be an
integer.
HEIGHT=“height”
Specifies the height of the image, either in pixels or as a percentage of the height of
the window, frame, or positioned block of HTML that contains the image. To indicate
a number of pixels specify the value as an integer, for example, “100”. To indicate a
percentage, specify the value as an integer followed by the percentage sign, for
example “20%”.
WIDTH=“width”
Specifies the width of the image either in pixels or as a percentage of the window,
frame, or positioned block of HTML containing the image. To indicate a number of
pixels specify the value as an integer, for example, “100”. To indicate a percentage,
specify the value as an integer followed by the percentage sign, for example, “20%”.
HSPACE= “horizMargin”
Specifies a margin in pixels between the left and right edges of the image and
surrounding text and images. Give the value as an integer.
VSPACE= “verticalMargin”
Specifies a margin in pixels between the top and bottom edges of the image and
surrounding text and images. Give the value as an integer.
Dummy Images
When an <IMG SRC> tag points to an image that does not exist, your browser
software substitutes a dummy image. When this happens during your final review of
your files, make sure that the referenced image does in fact exist, that the hyperlink
has the correct information in the URL, and that the file permission is set
appropriately.
External Images, Sounds and Animations
You may want to have an image open as a separate document when a user activates
a link on either a word or a smaller, inline version of the image included in your
document. This is called an external image, and it is useful if you do not wish to slow
down the loading of the main document with large inline images.
To include a reference to an external image:
<A HREF= “ExtImg.gif”>text or link</A>
You can also use a smaller image as a link to a larger image:
<A HREF = “BigImage.gif”><IMG SRC = “SmallImage. Gif”></A>
The reader sees the Smallimage.gif image and clicks on it to open the BigImage.gif
file.
You can use the same syntax for links to external animations and sounds. The only
difference is the file extension of the linked file like:
<A HREF= “K3GtheFilm.mov”> link anchor </A>
Specifies a link to a QuickTime movie. Some common file types and their extensions
are:
1) plain text : .txt
2) HTML document : .html
3) GIF image : .gif
4) X Bitmap image : .xbm
5) JPEG image : .jpg or .jpeg
6) AIFF sound file : .aiff
7) AU sound file : .au
8) WAV sound file : . wav
9) Quick Time movie : .mov
10) MPEG movie : .mpeg or .mpg
Examples:
Using table tags, ahref and img src tags with different attributes.
Table.html
<html>
<head><title> International Business Machines Corporation</title></head>
<body>
<marquee><H3> International Business Machines Corporation(IBMC)</H3></marquee>
<p> How your business can get smarter,To know more about International Business
Machines Corporation(IBM) product, services and career you can see our table and can
refer original website.
</p>
<table border="2″ cellpadding="20″ cellspacing="2″ align="center">
<tr>
<th colspan="3"> OUR SERVICES </th>
<tr>
<th> Product </th>
<th> Services</th>
<th> Prices</th>
</tr>
<tr>
<td> Cloud Computing</td>
<td> PC cloud </td>
<td> 9000</td>
</tr>
<tr>
<td> Mobile cloud </td>
<td>software</td>
<td> 1000</td>
</tr>
<tr>
<td> Security </td>
<td> Hardware </td>
<td> 9000</td>
</tr>
<tr>
<td> Storage </td>
<td> File Storage </td>
<td> 8000</td>
</tr>
</table>
<a href="next.html"><img src="cloud.png" title="cloud Picture" align="center"
width="500″ height="500″ ></a>
</body></html>
Next.html
<html>
<head><title> International Business Machines Corporation</title></head>
<body>
<H3> International Business Machines Corporation(IBMC)</H3>
<p> To know more about International Business Machines Corporation(IBM) product,
services and career you can visit original website.
</p>
<a href="table.html">Visit First page</a>
</body>
</html>
3. Write the extract output of the following HTML code with font specifications in
brackets:
Ans.
<HTML>
<body>
<h1> LIST OF BOOKS </h1> <hr>
<ul type =“circle”>
<li> How to solve it By computer
<li> HTML in Easy Steps
<li> C++ Programming
</ul>
<ol type = “A”>
<li> Microprocessor Programming
<li> Networking Essentials
<li> Microcontrollers.
</ol>
</body>
</html>
4. Write HTML code for a webpage displaying the following table.
Yesterday’s Weather
City High Low Wind
Mumbai 33 24 West
Pune 34 25 South
Latur 32 20 South
8. Write exact output of the following HTML. Code with font specifications in brackets:
<html>
<body>
<h1> <u> Network Connectivity Devices </u></h1>
<ul>
<li> Modern
<li> Hub
<ul>
<li> Repeater
<li> Router
</ul>
</ul>
</body>
</html>
Ans. Output is as follows with font specifications in brackets:
Network Connectivity Devices(Text size in h1,
Modem Regular default
Hub font is used)
o Repeater (Text size is default
o Router Regular font is used)
9. Write HTML Code for the following:
STREAM
13. Write exact output of the following HTML code with font specifications in bracket:
<HTML>
<BODY>
<H2> MY COUNTRY </H2>
<HR> <BR>
<H1 ALIGN = “CENTER”> INDIA
</H1> <BR>
<UL> IS
<LI> GREAT
<LI> BEAUTIFUL
<LI> LOVING
</UL>
Here people care for each other
<BODY>
</HTML>
Ans.
MY COUNTRY size H2
21. Write the exact output of the following HTML code with font specification in bracket.
<html>
<title>Introduction</title>
<body>
<h1> <b> Computer Science </b> </h1>
<hr>
<u> Paper I </u>
<hr>
<u> PaperII </u>
</body>
</html>
Ans.
Introduction Title
X
Output window:
Computer Science h1, bold
Paper I
PaperII
Exercise
Select the correct alternative and rewrite the following
6. Which of the following color name is not allowed to used in HTML _____
(i) OLIVE (ii) PURPLE (iii) ORANGE (iv) FUCHSIA
6. (iii) ORANGE
8. To place the image into an HTML file ________ attribute is used in IMG tag.
(i) URL (ii) ALT (iii) (iv) HREF
8. (iii) SRC
14. <A> tag has attribute ______ which defines URL of the document to be linked.
(i) SRC (ii) HREF (iii) VREF (iv) REF
14. (ii) HREF
15. In HTML, ______ attribute defines the name of the file in which the image is to be
found.
(i) ALIGN (ii) SIZE (iii) SRC (iv) BGCOLOR
15. (iii) SRC
33. An attribute which defines URL of document to be linked in <A> tag is ____
(i) REF (iii) VREF (iii) HREF (iv) ALT
33. (iii) HREF