HTML

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

HTML

A. Fill in the blanks.


1. The .... <head>............. tag contains information about the document.
2. HTML tag marks the .......START................. and the end of a web page.
3. The ......... <I>................. tag is used for displaying text in italics.
4. Tags which are used to give formatting effects to the text in a web page are
called .... formatting tags.... .
5. To give heading of maximum size use .......... <H1>................. tag.
B. State the difference between the following tags.
1. <HEAD> and <TITLE>

HEAD TITLE
<head> is a not displayed tag, it contains <title> is a tag to name your actual
information about the document itself. page, it appears at the top of your web
We can declare doctype and character browser window.
set inside head tag. The <title> tag is
inside the <head> tag

2. <BODY> and <P>


<BODY> <P>
The <P> tag is used to define the
The <body> tag defines the beginning of a new paragraph in a web
document's body. This comes after page.
the head element.
It leaves a blank line after the
paragraph. Thus, the text following the
The <body> element contains all the
contents of an HTML document, <P> appears on a new line.
such as headings, paragraphs,
images, hyperlinks, tables, lists, etc. The syntax used for the paragraph tag
is: <P> Paragraph 1 </P>
<body>

<h1>My First Heading</h1>


<p>My first paragraph. </p>

</body>
3. <I> and <B>
<I> <B>
Italics tag helps to display the text in Bold tag helps to display the text in
italics. It is a container element. bold. It is a container element.

The text written between <I> and The text written between the <B> and
</I> tag appears slightly tilted than </B> tags appear darker than the rest of
the text.
the rest of the text.
This tag is generally used to give
<I>Truth</I> headings or to highlight important
terms.
<B>Click Start</B>

4. <SUP> and <SUB>


<SUP> <SUB>
Superscript tag is used to display the Subscript tag is used to display the
text in the superscript format. text in the subscript format.
The text written between the <SUP> The text written between the <SUB>
and </SUP> tags appear slightly and </SUB> tags appear slightly
above the line. below the line.
This tag is mostly used with various This tag is used mainly with
mathematical values. mathematical and scientific
For example, X<SUP>2</SUP> data.
For example, The chemical formula
of water is H<SUB>2</SUB>O

5. <BR> and <NOBR>


<BR> <NOBR>
The <BR> tag is used to give a single The opposite of <BR> tag is <NOBR> tag.
line break. It is an empty element. It It is used to prevent any line breaks in
is used to the text enclosed between the tags.
give a forced line break without It forms a container element. Text
inserting any blank space in between placed between these tags is displayed
in a single line which may result in
the lines. This is
horizontal scrolling if the text is
an empty tag and does not require an
too long.
end tag.
<NOBR> This is a long piece of text
The syntax used is:
which explains the concept of no line
<BR> … Text ….
breaks in a paragraph. </NOBR>
C. Give the tags and the attributes for the following instructions.
1. Give the heading ‘My First Web Page’ in the centre of the page using the highest
heading level.
Ans: <h1> <CENTER> My First Web Page </CENTER> </h1>
2. To describe the web page as the HTML document.
Ans: <HTML> </HTML>
3. To change the colour of the visited link from purple to orange.
Ans: <body link = "purple" vlink="orange">
4. To align the text as the subscript of the text.
Ans: <p>This is <sub>subscripted</sub> text. </p>
5. To specify blue as the colour of the paragraph.
Ans: <p style="background-color:Blue">This is a paragraph.</p>
6. Insert small size image ‘SchoolLogo.bmp’ on the right side.
Ans: <IMG src=" SchoolLogo.bmp" height="30%" width="30%" align="right"
border="3" alt="SORRY IMAGE CANNOT BE DISPLAYED">

D. Find output of the following:


1. <B><I> This is an example to display text in both bold and italics. </I></B>
2. <B><I><U>This is an example to display text in bold, italics and underline.
</U></I></B>
3. Date of birth: 12<SUP>th</SUP> August 1988
E. Answer the following questions.
1. Why do you use HTML? Also, discuss various HTML elements.
Ans: HTML is a simple scripting language, mainly used for developing web
pages. It is easy to learn and simple to understand. The commands/keywords of
HTML are called tags. Tags are surrounded by angle brackets, < and >. You use tags
to create HTML elements, such as paragraphs or links. Many elements have an
opening tag and a closing tag — for example, a p (paragraph) element has a <p> tag,
followed by the paragraph text, followed by a closing </p> tag. HTML can also have
nested elements. For example, <B> <U> Click Start </U> </B>.

The basic elements of an HTML page are:

• Root Element <html> … </html> — This contains the HTML tag. It is a


container tag. This tag does not show directly on the web page. It is used to
detect the document as an HTML document.
• Head Element<HEAD> … </HEAD> -- This element contains information
about the document.
• Body Element: This element defines the document’s body. This comes after
the head element. The BODY tag is used to display text, images, links, etc. on
the web page. This may contain several other tags
• A text header, denoted using the <h1>, <h2>, <h3>, <h4>, <h5>, <h6> tags.
• A paragraph, denoted using the <p> tag.
• A link, denoted using the <a> (anchor) tag.
• A list, denoted using the <ul> (unordered list), <ol> (ordered list) and <li> (list
element) tags.
• An image, denoted using the <img> tag

2. What are tag attributes? Give examples.


Ans: Attributes of a tag provides additional information about the HTML elements.
They are always written by giving a space after the tag name. Attributes appear as an
attribute name followed by an ‘=’ sign and then the attribute value. Attribute values
should be enclosed within double quotes, though some browsers allow single quotes
as well. Different attributes in the same tag are separated by a space.
For example, 1) <IMG align="left"> Here, align="left" is an attribute of the HTML
element.
2)<BODY text="Blue"
bgcolor="Green"
leftmargin="60"
topmargin="50">

2A. Explain Body Tag and its important attributes?


This element defines the document’s body. This comes after the head element. The
BODY tag is used to display text, images, links, etc. on the web page. This may
contain several other tags.
The following are some important attributes of the <BODY> tag:
1.Text: This attribute specifies the color of the text of the entire document. The value
can be the name of the color within quotes.
2.Bgcolor: This attribute specifies the color of the background of the web page.
3.Leftmargin: This attribute sets the left margin of the web page. The value can be
given as a number or in percentage.
4.Topmargin: This attribute sets the margin at the top of the web page. The value
can be given as a number or in percentage.
5.Background: This attribute will make an image as the background of the web page.

3. Give the steps of executing an HTML program using a text editor.


1. Step 1: Open Notepad ...
2. Step 2: Write Some HTML. Write or copy some HTML into Notepad. ...
3. Step 3: Save the HTML Page. Save the file on your computer with name
ending with html or htm extension.
4. Step 4: View HTML Page in Your Browser. Open the saved HTML file in your
favourite browser.
5. What are hyperlinks? Give examples.

Ans: HTML links are hyperlinks. You can click on a link and jump to another
document. Hyperlinks can point to any resource on the web: an HTML page,
an image, a sound file, a movie, etc.

The tag used to produce links is called the Anchor tag, or <A> tag. This is a
container element. Everything between <A> and </A> behaves as the link.

<A> tag has the following attributes:

1. Href: This attribute is actually responsible for creating links. It has a


reference to the file or a website that opens when you click on a link.

The syntax used is:

<A href="URL">Link text</A>

where, URL is the address where the page should be directed. Link text is the
text on which the link is attached.

<A href="http://www.google.org"> google</A>

2. Name: This attribute is used to name a portion of a same document or


another document. This portion can then be linked by using href.

<A name="A1">

<H2> This is a trial page to show the linking<BR> of the portion of a


document. </H2>

</A>

<A HREF="#A1" click to move to the selected data</A>

Where the # in the href attribute defines a link to a named portion of the
document.

3. Title: This attribute gives additional information that pops up when the
mouse moves over it.

<A href="http://cambridgeindia.org" title="Welcome to Cambridge


website">Welcome </A>

4. Target: This attribute is used to specify where the linked document will
open.

<A href= "http:// cambridgeindia.org" target= "blank"> Targeted Anchor


</A>
What is internal and external Linking?
Internal Linking
When you link a portion of the same document then it is known as internal
linking. This is achieved by naming a selected portion by using name attribute
of <A> tag. When you click on a hyperlink, then a portion of the same
document becomes visible in the browser window.
External Linking
When you link two different documents then it is known as external linking.
You can also link to just a portion of another document instead of the whole
document by naming a portion by using name attribute of <A> tag. When you
click on hyperlink then a link to some other document opens in the browser
window.
6. What are formatting tags? Explain any two with example.
Tags which are used to give formatting effects to the text in a web page are
called the formatting tags.

7. Why do you use <CENTER> tag? Give suitable example.


Center tag displays the text or an image in the centre of the web page. It is a container

element. For example,

<HTML>

<BODY>

<CENTER>Center text </CENTER>

</BODY>

</HTML>
Artificial Intelligence
Fill in the blanks with the correct word.
1. ...IMPLEMENTING.................. is the last step in problem solving after
choosing the best solution.
2. Tasks that humans do on a routine basis without any special training
are called ........ cognitive tasks........... .
3. In ......VISION SYSTEMS..................... using AI, the systems can
understand and comprehend the visual input on the computer.
4. .. Artificial Intelligence......... is the science and engineering of making
intelligent machines, especially intelligent computer programs.
5. In ...SPEECH RECOGNITION............. AI is capable of handling speech
related data.

C d a e b
D. Answer the following questions.
1. Define AI.
According to the father of Artificial Intelligence, John McCarthy, it is ‘The
science and engineering of making intelligent machines, especially
intelligent computer programs. AI is a form of intelligence; a type of
technology which enables to perform tasks that normally require human
intelligence. It covers a broad range of domains and applications and is
expected to impact every field.
2. What are the tools used for AI?
Ans: The following tools are used to imbibe artificial intelligence in
computers.
Logic: Logic is used for concept representation and problem solving.
Search and Optimisation: Problems in AI can be solved when we search
through the best possible solutions.
Classifiers and Statistical Learning Methods: Classifiers are patterns or
observations, where each observation belongs to a class (i.e. decision to
be made).
Probabilistic Methods for Unrealistic Reasoning: Problems in AI in many
stages required to work with assumed data and circumstances. AI
researchers have devised a number of powerful tools to solve these
problems using probability theory and economics.
Artificial Neural Network: Neural as the name suggests is inspired by the
human nervous system.
3. What are the goals of AI?
Ans: Goals of AI are to:
1. implement human intelligence in machines by creating systems that
can think, act, learn and behave like humans.
2. create expert systems that can behave intelligently, learn, explain,
demonstrate and give suggestions to its users.
3. enable a system to understand and process natural language.
4. empower a system to perform intellectual tasks that a human can
perform.
4. What are the limitations of using AI?
Ans: The following are the limitations of using AI systems:
1. Developing AI enabled systems is very expensive.
2. Programming or training these systems is a tough job.
3. There is a lack of feelings, emotions and creativity in these systems.
4. Dependency on machine increases.

You might also like