0% found this document useful (0 votes)
7 views8 pages

HTML

The document provides a comprehensive overview of HTML, including explanations and examples of various HTML tags such as <BR>, <PRE>, <U>, and <IMG>. It also discusses the advantages and disadvantages of HTML, highlighting its ease of use and flexibility, while noting limitations like lack of programming features and error detection. Additionally, the document includes programming exercises requiring HTML code for specific outputs.

Uploaded by

kalyangamer242
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views8 pages

HTML

The document provides a comprehensive overview of HTML, including explanations and examples of various HTML tags such as <BR>, <PRE>, <U>, and <IMG>. It also discusses the advantages and disadvantages of HTML, highlighting its ease of use and flexibility, while noting limitations like lack of programming features and error detection. Additionally, the document includes programming exercises requiring HTML code for specific outputs.

Uploaded by

kalyangamer242
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

HTML XII CS

Chapter 3 HTML
Questions and Answers of Board Exam Papers of Previous Years.
1. Explain following tags with example. (2022, 2023, 2024, 2025)
a. <BR> - The HTML <br>tag is a line break element you can use in HTML code. It creates a line
break in text, effectively starting a new line without starting a new paragraph.
Example: <p>To force<br> line breaks<br> in a text,<br> use the br<br> element.</p>
Output:
To force
line breaks
in a text,
use the br
element.

b. <PRE> - 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.
Example:
<pre>
Text in a pre element
is displayed in a fixed-width
font, and it preserves
both spaces and
line breaks
</pre>
Output:
Text in a pre element
is displayed in a fixed-width
font, and it preserves
both spaces and
line breaks

c. <U> - The HTML <u> tag is used to define underlined text.


Example: <p>This is an <u>example</u> of underlined text.</p>
Output: This is an example of underlined text.

d. <SUB> - The HTML <sub> tag is used to define subscript text, which appears slightly below the
normal line of text. This is commonly used for mathematical formulas, chemical formulas.
Example: H<SUB>2</SUB>o
Output:H2O

Page 1
HTML XII CS

e. <HR> - The <hr> tag in HTML is used to create a horizontal line, typically to visually separate
content sections within a webpage. It's a self-closing tag, meaning it doesn't require a separate
closing tag like <hr>.

f. <B> - The <b> tag in HTML is used to render text in bold without marking it as important.
Example: This is normal text - <b>and this is bold text</b>
Output: This is normal text - and this is bold text

g. <UI> - The <ul> tag defines an unordered (bulleted) list. Use the <ul> tag together with the <li> tag
to create unordered lists.
Example:
<ul style="circle">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
Output:
o Coffee
o Tea
o Milk

h. <SUP> - The <sup> tag defines superscript text.


Example: This text contains superscript text like 12<sup>th</sup>.
Output: This text contains superscript text like 12th.

i. <IMG> - The <img> tag is used to embed an image in an HTML page. The <img> tag has two
required attributes:
 src - Specifies the path to the image
 alt - Specifies an alternate text for the image, if the image for some reason cannot be
displayed

Example: <img src="[Link]" alt="Image not visible" width="500" height="600">

j. <EM> - Mark up emphasized text in a document. The content inside is typically displayed
in italic.
Example: You <em>have</em> to hurry up!
Output: You have to hurry up!

k. <DL> - The <dl> tag defines a description list.


The <dl> tag is used in conjunction with <dt> (defines terms/names) and <dd> (describes each
term/name).

Page 2
HTML XII CS

Example:
<dl>
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>
<dd>White cold drink</dd>
</dl>
Output:
Coffee
Black hot drink
Milk
White cold drink

2. What is HTML? State advantages and disadvantages of HTML. (2023, 2024)


Answer –
1) HTML stands for Hyper Text Markup Language.
2) It is a text file containing small markup tags which are instructions to the browser about
how to display the page.
3) A HTML file must have .html file extension.
4) A HTML file can be created using a simple text editor like Notepad.

Advantages of HTML

1) HTML is easy to learn, use and implement.


2) It is flexible alternative to traditional presentation and complex software.
3) It contains powerful formatting facilities.
4) HTML documents are device and platform free or independent.
5) It is kind of software, which has been called world ware.
6) No expensive hardware or software is required.
7) Required HTML ages can be updated easily, without changing the whole document.
8) Controlled navigation is possible in HTML because of Hyperlinking.

Disadvantages of HTML

1) HTML doesn’t offer programming language features and capabilities.


2) Building complex pages is very time consuming.
3) It is easy to make mistakes e.g., leaving without “>”, “/” character.
4) Special types of scripting languages are required for handling different events and
validations.
5) No special debugging tool is provided, so it can’t detect errors easily.
6) User can write a HTML cade containing errors.

Page 3
HTML XII CS

Programming in HTML

1. Write s HTML code for the following output. (2022)

Program:
<HTML>
<BODY BGCOLOR=ORANGE>
<UL TYPE="SQUARE">
<LI>Computer
<OL TYPE="A">
<LI>Hardware
<OL TYPE="i">
<LI>Printer</LI>
<LI>Monitor</LI>
</OL></LI>
<li>Software
<OL TYPE="i">
<LI>C++
<UL TYPE="DISC">
<LI>ARRAYS</LI>
<LI>Pointers</LI>
</UL>
</LI></LI>
<LI>Java</LI>
</OL>
</LI>
</UL>

Page 4
HTML XII CS

</HTML>
2. Write s HTML code for the following output. (2023)

Program:

<HTML>
<BODY>
<TABLE BORDER=2>
<TR>
<TH ROWSPAN=2>Year</TH>
<TH COLSPAN=4>Students</TH>
</TR>
<TR>
<TH>Boys</TH>
<TH>Girls</TH>
<TH>Total</TH>
</TR>
<TR>
<TD>2011</TD>
<TD>95</TD>
<TD>75</TD>
<TD>170</TD>
</TR>
<TR>
<TD>2012</TD>
<TD>30</TD>
<TD>20</TD>
<TD>50</TD>
Page 5
HTML XII CS

</TR>
<TR>
<TD>2013</TD>
<TD>45</TD>
<TD>35</TD>
<TD>80</TD>
</TR>
<TR>
<TD>2014</TD>
<TD>55</TD>
<TD>75</TD>
<TD>130</TD>
</TR>
</TABLE>
</BODY>
</HTML>

3. Write s HTML code for the following output. (2024)

Program:
<HTML>
<BODY>
<UL TYPE="CIRCLE">
<LI>Arts
<OL TYPE="1">
<LI>Hindi</LI>
<LI>Marathi</LI>

Page 6
HTML XII CS

</OL>
</LI>
<LI>Commerce
<UL TYPE="SQUARE">
<LI>Tally</LI>
<LI>Accounts</LI>
</UL>
</LI>
<LI>Science
<OL TYPE="A">
<LI>Physics</LI>
<LI>Chemestry</LI>
</OL>
</LI>
</UL>
</BODY>
</HTML>

4. Write s HTML code for the following output. (2025)

Program:
<HTML>
<BODY>
<OL TYPE="i">
<LI>Arts
<OL TYPE="A">
<LI>History</LI>
Page 7
HTML XII CS

<LI>Geography</LI>
</OL>
</LI>
<LI>Science
<OL TYPE="I">
<LI>Computer Science</LI>
<LI>Physics</LI>
</OL>
</LI>
<LI>Commerce
<UL TYPE="CIRCLE">
<LI>English</LI>
<LI>Accounts</LI>
</UL>
</LI>
</OL>
</BODY>
</HTML>

Page 8

You might also like