Loading...
Please wait while we prepare your content
Please wait while we prepare your content
Solutions for Computer Applications, Class 10, CBSE
Consider the following web page:
(a) The text at P is :
(b) The link at R helps the user to :
(c) Clicking on the person serving in the image at Q displays another web page. This area in the image is a :
(d) The Internet can be used to find the websites of other tennis coaching associations by using :
(a) a web address
Reason — We write the URL or web address of a website in the address bar of the browser to access its content.
(b) send an email
Reason — The link at R uses "mailto" function to open an e-mail form directly which can be filled by the user and sent to the given email address.
(c) hyperlink
Reason — A hyperlink lets the user open another web page or document just by clicking on it.
(d) a search engine
Reason — A search engine helps a user to find information about any topic using keywords.
Write the HTML code to do the following :
To display a horizontal line of green colour.
<HR COLOR = "GREEN">
Write the HTML code to do the following :
To create a hyperlink on the word CLICK to an image named testimage.jpeg.
<A HREF = "testimage.jpeg">Click</A>
Write output of the following HTML code.
<html> <head> <title> Table </title> </head>
<body>
<table BORDER = "1">
<tr> <th ALIGN = "center" rowspan = "3"> ONE </th> <th> TWO </th>
<th>THREE </th> </tr>
<tr> <td> Rose </td> <td> Lily </td> </tr>
<tr> <td ALIGN = "center"> Pansy </td> <td ALIGN = "center"
colspan = "2"> Dahlia </td> </tr>
</table> </body> </html>
Observe the following table and write the HTML code to generate it :
<HTML>
<BODY>
<TABLE BORDER = "1">
<TR> <TH ROWSPAN = "2"> Serial No </TH> <TH ROWSPAN = "2"> Class </TH> <TH colspan = "3" ALIGN = "CENTER"> Number of Students </TH> </TR>
<TR ALIGN = "CENTER"> <TD> English </TD> <TD> Hindi </TD> <TD> Regional </TD> </TR>
<TR ALIGN = "CENTER"> <TD> 1 </TD> <TD> X A </TD> <TD> 35 </TD><TD> 10 </TD><TD> 6 </TD> </TR>
<TR ALIGN = "CENTER"> <TD> 2 </TD> <TD> X B </TD> <TD> 31 </TD><TD> 15 </TD><TD> 4 </TD> </TR>
</TABLE>
</BODY>
</HTML>
Write HTML code to create tables as shown below :
<HTML>
<BODY>
<TABLE BORDER = "1">
<TR> <TD> 1 </TD> <TD ROWSPAN = "2" VALIGN = "TOP"> 2 </TD><TD> 3 </TD> </TR>
<TR> <TD> 4 </TD> <TD> 6 </TD></TR>
<TR> <TD> 7 </TD> <TD> 8 </TD> <TD> 9 </TD></TR>
</TABLE>
</BODY>
</HTML>
Write HTML code to create tables as shown below :
<HTML>
<BODY>
<TABLE BORDER = "3">
<TR> <TD COLSPAN = "3"> Title goes here </TD> <TD> A </TD><TD ALIGN = "RIGHT"> B </TD> </TR>
<TR> <TD ROWSPAN = "3" ALIGN = "LEFT"> C </TD> <TD> D </TD><TD> E </TD><TD> F </TD><TD ALIGN = "RIGHT"> G </TD></TR>
<TR> <TD> H </TD><TD COLSPAN = "2" ALIGN = "CENTER"> I </TD><TD> </TD></TR>
<TR> <TD> K </TD><TD> L </TD><TD> M </TD><TD ALIGN = "RIGHT"> J </TD></TR>
<TR> <TD ALIGN = "RIGHT"> N </TD> <TD COLSPAN = "4" ALIGN = "CENTER"> O </TD> </TR>
</TABLE>
</BODY>
</HTML>
Write HTML code to create tables as shown below :
<HTML>
<BODY>
<TABLE BORDER = "1">
<TR> <TD ROWSPAN = "3"> Column 1 </TD> <TD> Row 1 </TD> </TR>
<TR> <TD> Row 2 </TD> </TR>
<TR><TD> Row 3 </TD> </TR>
</TABLE>
</BODY>
</HTML>
Write HTML code to create tables as shown below :
<HTML>
<BODY>
<TABLE BORDER = "1">
<TR> <TH COLSPAN = "2" BGCOLOR = "YELLOW"> Mammals - Plants - Fish </TH> </TR>
<TR> <TD BGCOLOR = "SKY BLUE" ROWSPAN = "3"> <B> Mammals </B> <BR> Farm Animals <BR> Big Game <BR> Small Critters </TD> <TD BGCOLOR = "LIGHTGREEN"> Cow </TD> </TR>
<TR> <TD BGCOLOR = "LIGHTGREEN"> Pig </TD> </TR>
<TR> <TD BGCOLOR = "LIGHTGREEN"> Horse </TD> </TR>
</TABLE>
</BODY>
</HTML>
To jump to new page, we use
<IMG>
tag<A>
tag<JUMP>
tag<A>
tag
Reason — The anchor tag <A>
is used to link a hypertext to a new document or jump to a new page.
Which of the following is not a valid value for align attribute of <IMG>
?
center
Reason — The align attribute of <IMG>
tag takes top, middle and bottom values. The value 'center' is not used.
If the image you are loading in the web page is not available, then you want a text to appear in the image place holder, which attribute lets you define this text ?
alt
Reason — The alt attribute specifies alternate text the browser may show if the image display is not possible or disabled by the user.
For linking to another web page, its URL is specified with ............... attribute of <A>
tag.
href
Reason — For linking to another web page, its URL is specified with href attribute of <A>
tag.
For internal linking, the section names are provided by ............... attribute of <A>
tag ?
name
Reason — For internal linking, the section names are provided by name attribute of <A>
tag.
............... attribute is used to specify the location of an image file.
src
Reason — src attribute is used to specify the location of an image file.
The ............... attribute of <img>
tag specifies an alternate text for an image, if the image cannot be displayed due to any reason.
alt
Reason — The alt attribute of <img>
tag specifies an alternate text for an image, if the image cannot be displayed due to any reason.
The default alignment of images, that are inserted in the web page, is ............... .
inline with text
Reason — The default alignment of images, that are inserted in the web page, is inline with text.
While creating a Web document, which unit is used to express an image's height and width ?
Pixels
Reason — While creating a Web document, pixels are used to express an image's height and width.
The default alignment of images, that are inserted in Web page, is :
Inline with text
Reason — The default alignment of images, that are inserted in Web page, is inline with text.
Border, frame, cellspacing, cellpadding, align are the attributes of :
<BODY>
<IMG>
<TABLE>
<TABLE>
Reason — Border, frame, cellspacing, cellpadding, align are the attributes of <TABLE> tag.
To create a link you surround the text or image with a(n) ............... tag.
anchor
Reason — To create a link you surround the text or image with a(n) anchor (<A>) tag.
The correct HTML code for inserting an image is :
<img href ="image.gif">
<img>
image.gif </gif>
<image src = "image.gif">
<img src = "image.gif">
<img src = "image.gif">
Reason — The correct HTML code for inserting an image is :
<img src = "image.gif">
Which will let text wrap down the side of the image?
<img src="myImage.gif" align="wrap">
<img src="myImage.gif" align="right">
<img src="myImage.gif" wrap="on">
<img src="myImage.gif" align="right">
Reason — 'src' attribute specifies the URL of the image file and 'align = right' tells the browser to place an image against the right margin.
Consider the following code :
<img src ="Computers.jpg" width ="...." height ="....">
Fill in the blanks to set the image size to be 250 pixels wide and 400 pixels tall.
250, 400
Reason — The 'height' and 'width' attribute of <IMG>
tag tell the browser to reserve space before actually downloading an image.
<img src ="Computers.jpg" width ="250" height ="400">
The above command tells the browser to reserve the image place with a width of 250 pixels and a height of 400 pixels.
The correct HTML code to display (P + Q)2 is:
<SUB>
( P+) 2 </SUB>
<SUP>
2 </SUP>
<SUP>
2 </SUP>
<SUP>
(P+Q) 2 </SUP>
(P + Q) <SUP>
2 </SUP>
Reason — The superscript tag <SUP>
is used to write (P + Q)2 by using the command —
(P + Q) <SUP>
2 </SUP>
The < ............... > tag displays text in subscript form.
sub
Reason — The <SUB>
tag displays text in subscript form.
The tag that starts a table cell is ............... .
<table>
<tc>
<td>
<tr>
<table>
Reason — The tag that starts a table cell is <table> tag.
What tag is used to add columns to tables ?
<colspan>
<td>
<tr>
<td>
Reason — <td> tag is used to add columns to tables.
Which has higher priority, cell settings or table settings ?
Cell settings
Reason — Cell settings have higher priority than table settings.
Choose the correct HTML to left-align the content inside a table cell.
<td valign="left">
<tdleft>
<td align="left">
<td leftalign>
<td align="left">
Reason — The "align" attribute is used to specify the horizontal alignment of the content within a table cell. By setting the "align" attribute to "left", the content inside the <td>
tag will be left-aligned.
Which of these tags are all <table>
tags ?
<thead><body><tr>
<table><tr><td>
<table><head><tfoot>
<table><tr><tt>
<table><tr><td>
Reason — The <table>
tag is used to define tables, <tr>
tag is used to define table rows and the <td>
tag is used to define data cells.
Settings for columns(<td>
tag) have higher priority than settings for rows(<tr>
tag).
True
Reason — In HTML, the <td>
tag is used to define a cell within a table, while the <tr>
tag is used to define a row. When applying settings to cells and rows, the settings applied directly to the <td>
tag will take precedence over settings applied to the <tr>
tag.
Which property tells how many rows a cell should span ?
rowspan = n
Reason — rowspan attribute specifies the number of rows a cell should span.
What is required to create a reference to a remote site that is different from creating a local link ?
<a>
tagThe Web address of the remote site
Reason — When creating a reference to a remote site, the URL of the remote site needs to be specified as the value of the href
attribute in the <a>
tag.
Which one of the following is the list type that will create a bulleted list ?
unordered
Reason — An unordered list type will create a bulleted list.
Why is it important to specify an image width and height in an <img>
tag ?
Specifying these dimensions helps a browser render pages faster.
Reason — Specifying the width and height of the image enables the browser to reserve space before actually downloading the image, speeding document rendering and eliminating the content shifting.
Which one of the following HTML tags is surrounded by <a></a>
container tags to create an image link ?
<img>
<ul>
<br>
<pic>
<img>
Reason — <img>
tag is surrounded by <a></a>
container tags to create an image link .
What is the general syntax for inline image ?
<src = img>
<src = image>
<img = file>
<img src = file>
<image src = file>
<img src = file>
Reason — The <img>
tag is used to insert images in HTML, and the "src" attribute is used to specify the path or URL of the image file. Therefore, the correct syntax for an inline image is:
<img src = file>
To create a link to an anchor, you use the ............... property in A tag.
Href
Reason — The href property in <A>
tag is used to create a link to an anchor.
Which of the following is used to specify the beginning of a table's row ?
TR
Reason — <TR>
tag is used to specify the beginning of a table's row.
In order to add border to a table, BORDER attribute is specified in which tag ?
TABLE
Reason — In order to add border to a table, BORDER attribute is specified in <TABLE>
tag in the following manner:
<TABLE BORDER = "2">
... contents ...
</TABLE>
Which of the following is an attribute of <Table>
tag ?
CELLPADDING
Reason — 'Cellpadding' is an attribute of <TABLE>
which gives the amount of space between the cell border and the cell contents.
What is the correct syntax in HTML for creating a link on a webpage ?
<LINK SRC = "abc.html">
<BODY LINK = "abc.html">
<A SRC = "abc.html">
<A HREF = "abc.html">
<A HREF = "abc.html">
Reason — In HTML, the <a>
tag is used to create a hyperlink, or link, on a webpage. The href
attribute is used within the <a>
tag to specify the destination of the link.
Choose the correct HTML code to create an email link ?
<A HREF = "xx@yy.com"></A>
<A HREF = "mailto:xx@yy.com"></A>
<MAIL = "xx@yy.com"></MAIL>
<A MAILHREF = "xx@yy.com"></A>
<A HREF = "mailto:xx@yy.com"></A>
Reason — In HTML, to create an email link, we need to use the mailto:
protocol followed by the email address. This protocol tells the browser to open the default email client with a new message addressed to the specified email address.
............... attribute is used with <A>
tag to specify the URL of link.
href attribute is used with <A>
tag to specify the URL of link.
No value is specified with ALT attribute of <IMG>
tag. (T/F)
False
Reason — The alt attribute specifies alternate text the browser may show if the image display is not possible or disabled by the user.
ROWSPAN with <TABLE>
tag is used to merge more than one cell row wise. (T/F)
False
Reason — ROWSPAN with <TD>
tag is used to merge more than one cell row wise.
Target attribute with <A>
tag is used to open a link in a new window. (T/F)
True
Reason — By setting the target attribute to "_blank", the link will open in a new window or tab, depending on the user's browser settings. For example:<a href="example.com" target="_blank">Open in New Window</a>
Align and Valign are the attributes used with <TD>
tag to set the alignment of data in a table. (T/F)
True
Reason — Align attribute is used to control the horizontal alignment of the contents of a cell and Valign is used to control the vertical alignment of the contents of a cell.
BORDER is an attribute of <A>
tag. (T/F)
False
Reason — BORDER is an attribute of <TABLE>
tag.
How to create hyperlinks.
<HTML>
<BODY>
<P>
<A href = "lastpage.htm">This text</A> is a link to a page on this Web site.</P>
<P>
<A href="http://www.microsoft.com/">
This text</A> is a link to a page on the World Wide Web.
</P>
</BODY>
</HTML>
Jump to another part of same document.
<HTML>
<BODY>
<P>
<A href = "#C4">
See also Chapter 4.
</A>
</P>
<P>
<H2>Chapter 1</H2>
<P>This chapter explains ba bla bla</P>
<H2>Chapter 2</H2>
<P>This chapter explains ba bla bla</P>
<H2>Chapter 3</H2>
<P>This chapter explains ba bla bla</P>
<A name="C4"><H2>Chapter 4</H2></A>
<P>This chapter explains ba bla bla</P>
<H2>Chapter 5</H2>
<P>This chapter explains ba bla bla</P>
<H2>Chapter 6</H2>
<P>This chapter explains ba bla bla</P>
<H2>Chapter 7</H2>
<P>This chapter explains ba bla bla</P>
</BODY>
</HTML>
Create a basic 3x2 table.
<HTML>
<BODY>
<TABLE BORDER>
<TR>
<TD>A</TD> <TD>B</TD> <TD>C</TD>
</TR>
<TR>
<TD>D</TD> <TD>E</TD> <TD>F</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Demonstration of rowspan.
<HTML>
<BODY>
<TABLE BORDER>
<TR>
<TD ROWSPAN=2>Item 1</TD>
<TD>Item 2</TD> <TD>Item 3</TD>
<TD>Item 4</TD>
</TR>
<TR>
<TD>Item 5</TD> <TD>Item 6</TD>
<TD>Item 7</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Demonstration of colspan and headers.
<HTML>
<BODY>
<TABLE BORDER>
<TR>
<TH COLSPAN=2>Head1</TH> <TH COLSPAN=2>Head2</TH>
</TR>
<TR>
<TD>A</TD> <TD>B</TD>
<TD>C</TD> <TD>D</TD>
</TR>
<TR>
<TD>E</TD> <TD>F</TD>
<TD>G</TD> <TD>H</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Demonstration of Side Headers, Rowspan.
<HTML>
<BODY>
<TABLE BORDER>
<TR><TH ROWSPAN=2>Head1</TH>
<TD>Item 1</TD> <TD>Item 2</TD>
<TD>Item 3</TD> <TD>Item 4</TD>
</TR>
<TR>
<TD>Item 5</TD> <TD>Item 6</TD>
<TD>Item 7</TD> <TD>item8</TD>
</TR>
<TR><TH>Head2</TH>
<TD>Item 9</TD> <TD>Item 10</TD>
<TD>Item 3</TD> <TD>Item 11</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Sample table using many things.
<HTML>
<BODY>
<TABLE BORDER>
<TR> <TD><TH ROWSPAN=2></TH>
<TH COLSPAN=2>Average</TH></TD>
</TR>
<TR>
<TD><TH>Height</TH>
<TH>Weight</TH></TD>
</TR>
<TR>
<TH ROWSPAN=2>Gender</TH>
<TH>Males</TH><TD>1.9</TD>
<TD>0.003</TD>
</TR>
<TR>
<TH>Females</TH>
<TD>1.7</TD><TD>0.002</TD> </TR>
</TABLE>
</BODY>
</HTML>
Tables using Cellpadding and Cellspacing.
<HTML>
<BODY>
<TABLE BORDER CELLPADDING=10 CELLSPACING=0>
<TR>
<TD>A</TD> <TD>B</TD> <TD>C</TD>
</TR>
<TR>
<TD>D</TD> <TD>E</TD> <TD>F</TD>
</TR>
</TABLE>
<TABLE BORDER CELLPADDING=0 CELLSPACING=10>
<TR>
<TD>A</TD> <TD>B</TD> <TD>C</TD>
</TR>
<TR>
<TD>D</TD> <TD>E</TD> <TD>F</TD>
</TR>
</TABLE>
<TABLE BORDER CELLPADDING=20 CELLSPACING=20>
<TR>
<TD>A</TD> <TD>B</TD> <TD>C</TD>
</TR>
<TR>
<TD>D</TD> <TD>E</TD> <TD>F</TD>
</TR>
</TABLE>
<TABLE BORDER=5 CELLPADDING=20 CELLSPACING=5>
<TR>
<TD>A</TD> <TD>B</TD> <TD>C</TD>
</TR>
<TR>
<TD>D</TD> <TD>E</TD> <TD>F</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Table with different vertical alignments in its cells.
<HTML>
<BODY>
<TABLE BORDER>
<TR>
<TH>January</TH>
<TH>February</TH>
<TH>March</TH>
</TR>
<TR ALIGN=center>
<TD>all aligned center</TD>
<TD>Cell 2</TD>
<TD>Another cell,<br> cell 3</TD>
</TR>
<TR>
<TD ALIGN=right>aligned right</TD>
<TD ALIGN=center>aligned to center</TD>
<TD>default,<br>aligned left</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Fill in the blanks:
(i) To insert a table on a web page, we use ............... tag.
(ii) ............... tag is used to create inline images.
(iii) ............... is an attribute of the <IMG>
tag which specifies the location or URL of the image to be displayed.
(iv) The default colour of a hyperlink on a web page is ............... .
(v) The ............... tag is used to create subscripts and ............... tag is used to create superscripts on a web page.
(vi) An ............... link allows a link to another web page or another web site.
(vii) The attribute ............... is used for specifying the URL of the anchor tag.
(viii) ............... is used to combine the cells horizontally.
(ix) ............... tags creates a bulleted list.
(x) ............... attribute with <HR>
tag is used to specify thickness of the line.
(i) To insert a table on a web page, we use <TABLE>tag.
(ii) <IMG> tag is used to create inline images.
(iii) SRC is an attribute of the <IMG>
tag which specifies the location or URL of the image to be displayed.
(iv) The default colour of a hyperlink on a web page is blue.
(v) The <SUB> tag is used to create subscripts and <SUP> tag is used to create superscripts on a web page.
(vi) An external link allows a link to another web page or another web site.
(vii) The attribute HREF is used for specifying the URL of the anchor tag.
(viii) COLSPAN is used to combine the cells horizontally.
(ix) <UL>...</UL> tags creates a bulleted list.
(x) SIZE attribute with <HR>
tag is used to specify thickness of the line.
State True or False:
(i) Line breaks are given through <BR>
.
(ii) HTML is a programming language.
(iii) The default font size is 5.
(iv) Color attribute is used with <P>
tag.
(v) The colour of the hyperlinks in an HTML document cannot be changed.
(vi) The <A>
tag is called the align tag.
(vii) <TR>
tag is used to specify the individual table data in a table.
(viii) The ALT attribute of the <IMG>
tag is used to specify the text that is to be displayed in case the browser does not support graphics.
(ix) XML is not a markup language.
(x) It is not important to specify an integer value as the width of the border of an image.
(xi) The ALIGN attribute of the <IMG>
tag is used to specify the text that is to be displayed in case the browser does not support graphics.
(xii) <TH>
tag is used to specify the column heading in a table.
(xiii) The NAME attribute of the <A>
tag allows the user to create links within the same document.
(xiv) The <A>
tag is called the align tag.
(i) True
Reason — <BR>
tag is used to break the current line and jump to the next line.
(ii) False
Reason — HTML is a Webpage Layout Language and a Hyperlink Specification Language. It is not a programming language.
(iii) False
Reason — The default font size is 3.
(iv) False
Reason — Color is not an attribute of <P>
tag. Color is used with <Font>
tag to set the colour of the text.
(v) False
Reason — The colour of the hyperlinks in an HTML document can be changed by using the ALINK, VLINK attributes with the <BODY>
tag.
(vi) False
Reason — The <A>
tag is called the anchor tag.
(vii) False
Reason — <TD>
tag is used to specify the individual table data in a table. <TR>
tag is used to specify a new row in a table.
(viii) True
Reason — The ALT attribute of the <IMG>
tag is used to specify the text that is to be displayed in case the browser cannot display the image for some reason.
(ix) False
Reason — XML stands for Xtensible Markup Language and it is a markup language.
(x) False
Reason — The width attribute requires an integer value that indicates the image size in pixels.
(xi) False
Reason — The ALT attribute of the <IMG>
tag is used to specify the text that is to be displayed in case the browser does not support graphics. The ALIGN attribute is used to align the image.
(xii) True
Reason — <TH>
tag is used to specify the column heading in a table. The headings appear slightly different than the normal table data.
(xiii) True
Reason — The NAME attribute specifies the name of a section in the document. This name is used to create links using the HREF attribute.
(xiv) False
Reason — The <A>
tag is called the anchor tag.
To create a link, we must use ............... attribute with tag.
href
Reason — For linking to another web page, its URL is specified with href attribute of <A>
tag.
Which of the following is an attribute of <table>
tag ?
cellpadding
Reason — Cellpadding gives the specified amount of space between the cell border and the cell contents.
Which attribute is not valid for <body>
tag ?
color
Reason — color
is not a valid attribute for <body>
tag. The other attributes are used with <BODY>
tag to specify the following —
Which of the following is not an attribute of <Table>
tag ?
Src
Reason — Src
is an attribute of <IMG>
tag which accepts the path or URL of the image. The BORDER, BACKGROUND and BGCOLOR attribute of <TABLE>
tag specify the border, background image and the background colour of the table, respectively.
Which command should we use to link a page with an HTML page ?
<a link = "page.htm"> </a>
<a href = "page.htm"> page </a>
<a connect = "page.htm"> </a>
<a attach = "page.htm"> </a>
<a href = "page.htm"> page </a>
Reason — To link a page with an HTML page, its name and location is specified with href
attribute of <A>
tag.
SRC attribute used with <IMG>
tag stands for :
Source
Reason — SRC attribute is used to specify the source/location of an image file.
Which of the following is not a valid value for align attribute of <IMG>
tag ?
center
Reason — The align attribute of <IMG>
tag takes top, middle and bottom values. 'center' is not a valid value.
We can create a numbered list using ............... tag.
<ul>
<list>
<ol>
<dl>
<ol>
Reason — The <ol>
tag is used to define a numbered or ordered list
colspan = n can be added to ............... tag :
<hr>
<table>
<td>
<tr>
<td>
Reason — COLSPAN attribute is used with <TD>
tag to merge more than one columns into a single cell.
The correct HTML code for inserting an image is :
<img href = "image.gif">
<img> image.gif </img>
<img src = "image.gif">
<image src = "image.gif">
<img src = "image.gif">
Reason — To insert an image in an HTML document, we use the <IMG>
tag along with its attribute SRC which specifies the location or URL of the image.
Which of the following are the attributes of <table>
?
<Border>
<img>
<table>
None of these
Reason — The options specified are HTML tags not attributes.
The attribute used to specify the background colour of a table is :
BGCOLOR
Reason — The attribute BGCOLOR is used to specify the background colour of a table.
Which of the following is an attribute of <TABLE>
tag ?
CELLPADDING
Reason — Cellpadding specifies the amount of space to be given between the cell border and the cell contents.
Which of the following tag is suitable for creating numbered list ?
<BL>
<OL>
<UL>
<DL>
<OL>
Reason — <OL>
tag is suitable for creating numbered list.
The two common attributes of the <IMG>
and the <TABLE>
tag are :
HEIGHT and WIDTH
Reason — Two common attributes of the <IMG>
and the <TABLE>
tag are HEIGHT and WIDTH.
Write the full forms of :
(i) XML
(ii) FTP
(iii) <img>
(iv) <HR>
(i) XML — Xtensible Markup Language
(ii) FTP — File Transfer Protocol
(iii) <img>
— Image tag
(iv) <HR>
— Horizontal rule tag
Name the attributes of <img>
tag which are used for specifying its dimensions in a web page.
The HEIGHT and WIDTH attributes require integer values to specify the height and width of the image in pixels.
What do you understand by VLINK ?
VLINK is an attribute of <BODY>
tag. It specifies the color of the visited links in a document.
Identify which of the following is a tag or an attribute :
(i) border
(ii) img
(iii) alt
(iv) src
(v) href
(i) border — Attribute
(ii) img — Tag
(iii) alt — Attribute
(iv) src — Attribute
(v) href — Attribute
Consider the HTML code :
<A HREF = #intro> Introduction </A>
In the above code,
(i) What is the purpose of # ?
(ii) What will happen when the user clicks "Introduction" ?
(i) # is used to place the anchor at a given section in a document.
(ii) When "Introduction" is clicked, the user is taken to the section of the document named "intro".
Observe the following table and write the HTML code to generate it :
<HTML>
<BODY>
<TABLE BORDER="1">
<TR> <TH COLSPAN = "4" ALIGN = "CENTER">Marks</TH> </TR>
<TR>
<TD ALIGN = "CENTER"> English </TD>
<TD ALIGN = "CENTER"> Maths </TD>
<TD ALIGN = "CENTER"> Economics </TD>
<TD ALIGN = "CENTER"> Physics </TD>
</TR>
<TR>
<TD ALIGN = "CENTER"> 67 </TD>
<TD ALIGN = "CENTER"> 89 </TD>
<TD ALIGN = "CENTER"> 77 </TD>
<TD ALIGN = "CENTER"> 92 </TD>
</TR>
</TABLE>
</BODY>
</HTML>
Write the names of two attributes each for the following tags :
(i) <HR>
(ii) <Body>
(iii) <img>
(iv) <Table>
(v) <A>
(i) <HR>
— WIDTH, NOSHADE
(ii) <Body>
— BGCOLOR, BACKGROUND
(iii) <img>
— SRC, ALT
(iv) <Table>
— BORDER, ALIGN
(v) <A>
— NAME, HREF
Observe the following table and write the HTML code to generate it :
Note. 1st row has pink background.
<HTML>
<BODY>
<TABLE BORDER="1">
<TR>
<TH BGCOLOR = "PINK" ALIGN = "CENTER">Question</TH>
<TH BGCOLOR = "PINK" ALIGN = "CENTER">Marks</TH>
</TR>
<TR>
<TD ROWSPAN = "3" ALIGN = "CENTER">1</TD>
<TD ALIGN = "CENTER">2</TD>
</TR>
<TR>
<TD ALIGN = "CENTER">2</TD>
</TR>
<TR>
<TD ALIGN = "CENTER">5</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Write the HTML code to generate the following output :
Note the following points while generating the webpage :
(i) Link colour is green, active link colour is blue and visited link colour is red.
(ii) Title of the page is "Dances of India".
(iii) Heading of the page is maroon.
(iv) Background colour of page is yellow.
(v) Image used is "dance.png".
(vi) Caption of table is blue.
(vii) Table border is blue and of size 2.
(viii) The 3 links are one.html, two.html and three.html.
(ix) The email id for contact us is abc@xyz.com
<HTML>
<HEAD>
<TITLE> Dances of India </TITLE>
</HEAD>
<BODY LINK = "GREEN" ALINK = "BLUE" VLINK = "RED" BGCOLOR = "YELLOW">
<FONT COLOR = "MAROON">
<H1 ALIGN = "CENTER">Dances of India </H1>
</FONT>
<IMG SRC = "DANCE.JPG" HEIGHT = "100" WIDTH = "100" ALIGN = "RIGHT">
<P>
There are many types of dance in India, from those which are deeply religious in content to those which are danced on more trivial happy occasions. <BR>
Classical dances of India are usually always spiritual in content, although this is often true also of Folk dances.
</P>
<TABLE BORDER = "2" BORDERCOLOR = "BLUE" ALIGN = "CENTER">
<CAPTION>
<FONT COLOR = "BLUE">DANCES OF INDIA</FONT>
</CAPTION>
<TR>
<TH ALIGN = "CENTER">CLASSICAL DANCES </TH>
<TH ALIGN = "CENTER">FOLK DANCES </TH>
</TR>
<TR>
<TD>Mohini Attam</TD>
<TD>Hikat of Himachal Pradesh </TD>
</TR>
<TR>
<TD>Bharata Natyam </TD>
<TD>Rouff of Kashmir </TD>
</TR>
<TR>
<TD>Odissi </TD>
<TD>Hurkia Baol of Kumaon </TD>
</TR>
</TABLE>
<H4>List</H4>
<UL TYPE = "NONE">
<LI>
<A HREF = "one.html">Mohini Attam</A>
</LI>
<LI>
<A HREF = "two.html">Bharata Natyam</A>
</LI>
<LI>
<A HREF = "three.html">Odissi</A>
</LI>
<LI>
<A HREF = "mailto:abc@xyz.com">Contact Us</A>
</LI>
</UL>
</BODY>
</HTML>
Write the HTML code to generate the following output :
Note the following points while generating the webpage :
(i) Title of the page should be "Dubai Tourism".
(ii) The heading text "Welcome to Dubai" is in Arial font and is of maroon color.
(iii) The horizontal lines below the heading are 5 pixels thick and of red color.
(iv) Image used in the page is burj.jpg.
(v) The bulleted list contains links as specified below :
<HTML>
<HEAD>
<TITLE> Dubai Tourism </TITLE>
</HEAD>
<BODY >
<FONT FACE = "ARIAL" COLOR = "MAROON">
<H1 ALIGN = "CENTER">WELCOME TO DUBAI </H1>
</FONT>
<HR SIZE = "5" COLOR = "RED" ALIGN = "CENTER" WIDTH = "50%">
<HR SIZE = "5" COLOR = "RED" ALIGN = "CENTER" WIDTH = "30%">
<FONT SIZE = 5>
Enjoy the world of pure travel masti
</FONT>
<IMG SRC = "BURJ.JPG" HEIGHT = "100" WIDTH = "100" ALIGN = "BOTTOM">
<P>The following is a list of major tourist attractions in Dubai :</P>
<UL TYPE = "DISC">
<LI>
<A HREF = "morning.html">Morning</A> - Dolphinarium and Palm Dubai
</LI>
<LI>
<A HREF = "evening.html">Evening</A> - Ski Dubai and Cruise
</LI>
</UL>
<CENTER>For enquiries write at <A HREF = "mailto:dubai@gmail.com">dubai@gmail.com</A></CENTER>
</BODY>
</HTML>
What is meant by inline images in HTML ?
Inline image means that image displays in line with the text, i.e., the specified image is loaded separately and placed into the text flow as if the image were some special character.
Name various types of alignments available for images.
The various types of alignments available for images are:
Which attributes of <A>
facilitates external linking ?
The attributes of <A>
tag which facilitate external linking are:
Which attribute of <A>
facilitates internal linking ?
The attributes of <A>
tag which facilitate internal linking are:
What for is Mailto function used ?
The "mailto" function is used to create email links on webpages, allowing users to click on the link and open their default email client with a new message addressed to the specified email address.
Write HTML code to create the following ordered list :
X. Xylophone
Y. Yak
Z. Zebra
<OL TYPE = "A" START = "24">
<LI> Xylophone </LI>
<LI> Yak </LI>
<LI> Zebra </LI>
</OL>
How would you indent a single word and put a square bullet in front of it ?
To indent a single word and put a square bullet in front of it, we can use an unordered list in the following way:
<UL TYPE = "SQUARE">
<LI> Word </LI>
</UL>
Write the HTML code to create the following indentation effect :
Apple pie,
pudding,
and pancake,
All begin with an A.
Apple pie, <BR>
pudding, <BR>
and pancake, <BR>
All begin with an A.
Use a definition list in a table to show that the word "glunch" means "a look of disdain, anger, or displeasure" and that the word "glumpy" means "sullen, morose, or sulky."
<HTML>
<BODY>
<TABLE>
<TR>
<TD>
<DL>
<DT> Glunch </DT>
<DD> a look of disdain, anger, or displeasure</DD>
</DL>
</TD>
</TR>
<TR>
<TD>
<DL>
<DT> Glumpy </DT>
<DD> sullen, morose, or sulky</DD>
</DL>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
How would you make the word Elephant appear whenever the actual elephant.jpg image couldn't be displayed by a Web browser ?
We can do this by setting the value of alt attribute to 'Elephant' in the following way:
<IMG SRC = "ELEPHANT.JPG" ALT = "ELEPHANT">
Write the HTML to make the elephant.jpg image appear on the right side of the page, with a big headline reading "Elephants of the World Unit!" on the left side of the page next to it.
<H1>Elephants of the World Unit!<IMG SRC = "ELEPHANT.JPG" ALIGN = "RIGHT"></H1>
How would you insert an image file named elephant.jpg at the very top of a Web page ?
To insert the image at the very top of a Web page, the align attribute of <IMG>
tag should be set to "top" in the following way:
<IMG SRC = "ELEPHANT.JPG" ALIGN = "TOP">
Suppose you have a large picture of a standing elephant named elephant.jpg. Now make a small named fly.jpg appear to the left of the elephant's head and mouse.jpg appear next to the elephant's right foot.
The HTML code to perform the given task is as follows:
<IMG SRC = "FLY.JPG" ALIGN = "TOP"><IMG SRC = "ELEPHANT.JPG"><IMG SRC = "MOUSE.JPG" ALIGN = "BOTTOM">
Your home page will be at http://www.mysite.com/home.htm
when you put it on the Internet. Write the HTML code to go on that page so that when someone clicks the words All About Me, they see the page located at http://www.mysite.com/mylife.htm.
The command to perform the given task is as follows:
<A HREF = "mylife.htm"> All About Me </A>
You plan to publish a CD-ROM disk containing HTML pages. How do you create a link from a page in the \guide folder to the \ guide \ mains \ kolkata.htm page ?
<A HREF = "mains/kolkata.htm"> Kolkata </A>
Name the following with respect to HTML :
Element to create a hyperlink.
Anchor tag <A>...</A>
What is a table ? Which tag is used to create tables in HTML ?
An HTML table allows a user to arrange data — text, preformatted text, images, links, forms, form fields, other tables, etc., into rows and columns of cells.
The table tag <TABLE>...</TABLE>
is used to create tables in HTML.
Which attributes are used to give border to a table ?
The attributes which are used to give border to a table are:
Which attribute lets you control the display of select border sides of a table ?
Frame attribute lets us control the display of select border sides of a table.
Which attribute is used to control the inside table border ?
Rules attribute is used to control the inside table border.
How is spacing in cells of table controlled ?
To control the spacing of cells, the 'Cellspacing' and 'Cellpadding' attributes are used.
Consider the following example:
<TABLE BORDER = "3" CELLSPACING = "1" CELLPADDING = "1">
<TR> <TD> Fruits </TD> <TD> Vegetables </TD> </TR>
<TR> <TD> Mango, Apple, Banana </TD> <TD> Potato, Aubergine, Gourd </TD> </TR>
</TABLE>
What is the role of ALIGN attribute of <TABLE>
tag ?
Align attribute of <TABLE>
tag is used to align the table on a web page. It can have the following values — left, right and center. These values indicate whether the table should be placed flush against the left or right margin of the text flow, with the text flowing around the table or in the middle with the text flow above and below.
What is the use of having a SUMMARY attribute in <TABLE>
tag ?
The summary attribute is used to provide a long description of the table's purpose. It is usually given for the benefit of people using speech or Braille based user agents.
How can you specify following in a table :
(i) background image
(ii) background colour
(iii) table height
(iv) table width ?
(i) background
attribute is used to specify the background image in a table.
(ii) bgcolor
attribute is used to specify the background color in a table.
(iii) height
attribute is used to specify the height of a table.
(iv) width
attribute is used to specify the width fo a table.
Which tag is used to specify
(i) table data ?
(ii) table header ?
(iii) table row ?
(i) <TD>
tag
(ii) <TH>
tag
(iii) <TR>
tag
Name the attributes used for following :
(i) Setting the cell width
(ii) Setting cell's background image
(iii) Setting cell's background colour
(iv) Changing the cell span
(v) Aligning cell contents vertically.
(i) width
(ii) background
(iii) bgcolor
(iv) rowspan
and colspan
(v) valign
What for are <TH>
and <TR>
tags used ?
<TH>
tag stand for table header. The contents declared as header are displayed in a distinctive style, like bold-faced.
<TR>
tag stands for table row. <TR>
marks the beginning of a table row and </TR>
marks the end of a table row.
A set of header rows is defined using ............... tag.
A set of header rows is defined using <THEAD>
tag.
Which tags divide HTML tables in multiple sections ?
The <THEAD>
, <TBODY>
and <TFOOT>
tags are used to divide HTML tables in multiple sections. While the <THEAD>
and <TFOOT>
tags define the header and footer sections , the <TBODY>
tag defines the body section of the table.
What attributes can you use with TABLE tag but not with TR tag ?
We can use the following attributes with TABLE tag but not with TR tag —
summary
rules
frame
border
bordercolor
cellpadding
cellspacing
height
width
Can you insert hyperlinks inside table cells ?
Yes, we can insert hyperlinks inside table cells by using the anchor tag <A>...</A>
.
How do you create different table section ?
The <THEAD>
, <TBODY>
and <TFOOT>
tags are used to divide HTML tables in different sections. While the <THEAD>
and <TFOOT>
tags define the header and footer sections , the <TBODY>
tag defines the body section of the table.
Consider the following example:
<HTML>
<BODY>
<TABLE>
<THEAD BGCOLOR = "PINK">
<TR>
<TD> Header </TD> <TD> Header </TD>
</TR>
</THEAD>
<TBODY BGCOLOR = "YELLOW">
<TR>
<TD> Body cell data </TD> <TD> Body cell data </TD>
</TR>
<TR>
<TD> Body cell data </TD> <TD> Body cell data </TD>
</TR>
</TBODY>
<TFOOT>
<TR>
<TD> Footer </TD> <TD> Footer </TD>
</TR>
</TFOOT>
</TABLE>
</BODY>
</HTML>
Write code to produce following HTML table :
<HTML>
<BODY>
<TABLE>
<TR> <TD ROWSPAN = "2"> A </TD> <TD> B </TD> </TR>
<TR> <TD> C </TD> </TR>
</TABLE>
</BODY>
</HTML>
Write HTML code to produce following table :
<HTML>
<BODY>
<TABLE frame = "void" rules = "all">
<TR> <TD> A </TD> <TD> D </TD> </TR>
<TR> <TD> B </TD> <TD> E </TD> </TR>
<TR> <TD> C </TD> <TD> F </TD> </TR>
</TABLE>
</BODY>
</HTML>
Write HTML code to produce following table :
<HTML>
<BODY>
<TABLE frame = "lhs" rules = "all">
<TR> <TD> A </TD> <TD> C </TD><TD> E </TD> </TR>
<TR> <TD> B </TD> <TD> D </TD> <TD> F </TD></TR>
</TABLE>
</BODY>
</HTML>
Write HTML code to produce following table :
<HTML>
<BODY>
<TABLE frame = "above" rules = "all">
<TR> <TD> A </TD> <TD> B</TD><TD> C </TD> <TD> D </TD></TR>
<TR> <TD> E </TD> <TD> F </TD> <TD> G </TD> <TD> H </TD></TR>
</TABLE>
</BODY>
</HTML>
Create a table having three header rows with yellow background colour, five table-body rows having pink colour and two footer rows having cyan colour. Assume table contents on your own.
<HTML>
<BODY>
<TABLE>
<THEAD>
<TR> <TD BGCOLOR = "YELLOW"> Names </TD> </TR>
<TR> <TD BGCOLOR = "YELLOW"> Of </TD> </TR>
<TR> <TD BGCOLOR = "YELLOW"> Fruits </TD> </TR>
</THEAD>
<TBODY>
<TR> <TD BGCOLOR = "PINK"> Apple </TD> </TR>
<TR> <TD BGCOLOR = "PINK"> Mango </TD> </TR>
<TR> <TD BGCOLOR = "PINK"> Banana </TD> </TR>
<TR> <TD BGCOLOR = "PINK"> Guava </TD> </TR>
<TR> <TD BGCOLOR = "PINK"> Pineapple </TD> </TR>
</TBODY>
<TFOOT>
<TR> <TD BGCOLOR = "CYAN"> Note </TD> </TR>
<TR> <TD BGCOLOR = "CYAN"> Fruits are rich in fibre. </TD> </TR>
</TFOOT>
</TABLE>
</BODY>
</HTML>
Write code to produce following HTML tables :
(i)
<HTML>
<BODY>
<TABLE frame = "border" rules = "cols">
<TR> <TD> A </TD> <TD> B </TD><TD> C </TD> </TR>
<TR> <TD> D </TD> <TD> E </TD> <TD> F </TD></TR>
</TABLE>
</BODY>
</HTML>
(ii)
<HTML>
<BODY>
<TABLE frame = "border" rules = "none">
<TR> <TD> A </TD> <TD> B </TD><TD> C </TD> <TD> D </TD></TR>
<TR> <TD> E </TD> <TD> F </TD> <TD> G </TD><TD> H </TD></TR>
</TABLE>
</BODY>
</HTML>
Write code to produce following HTML table :
<HTML>
<BODY>
<TABLE>
<TR ALIGN = "CENTER">
<TD> A </TD>
<TD COLSPAN = "3"> B </TD>
</TR>
<TR ALIGN = "CENTER">
<TD> C </TD>
<TD> D </TD>
<TD> E </TD>
<TD ROWSPAN = "2"> H </TD>
</TR>
<TR ALIGN = "CENTER">
<TD> C </TD>
<TD COLSPAN = "2"> H </TD>
</TR>
</TABLE>
</BODY>
</HTML>