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

HTML BASIC QUESTIONS

Ques:1) What do you understand by HTML?


Ans: HTML stands for Hyper text markup language. HTML was invented by Tim Berners Lee in 1990. HTML
is used to describe the structure of a web page, and convey how text or graphics are displayed. HTML is the
"mother tongue" of the browser.

Ques:2)How to create a HTML document(web page)?


Ans: To create a HTML Document follow these steps:
A)open a text editor tool (ex- notepad), notepad++,sublime editor ,wordpad
B) Create a HTML document in text editor.
C) save the file with .HTML / .HTM extension (Ex myfile.html).
D)open the file in browser.your HTML document is ready to view.

Ques:3) Define the basic structure of a HTML program?


Ans: A normal HTML web page is divided into two sections-
(A) Head-The head is used for text and tags that do not show directly on the page.
(B) Body-the body is used for text and tags that are show directly on the page.
Example: <HTML>
<HEAD>
<TITLE>MY FIRST PAGE IN HTML</TITLE>
</HEAD>
<BODY>THIS IS A WEBPAGE DESIGNED IN HTML</BODY>
</HTML>

Ques:4) How to view a web page or HTML file?


Answer: to view the result or output of the HTML program, you need a special program called the web
browser (Ex. Internet explorer, chrome, firefox).
To view these file follow these steps:
A)open the browser.
B) open the html file by pressing ctrl+O.
C) select your file location and click on OK button.
D) your HTML file will be open.

Ques:5)What is head section in HTML?


Ans:The head section of the web page includes all the stuff that does not show directly on the resulting
page.The <title> and </title> tag encapsulate the title of your page also a part of head section.

Ques:6) What is Body section in HTML?


Answer: the <body> element is where all content is placed. It include paragraph, picture, table etc.The
content placed in body show on web page.

Ques:7)-What do you understand by Hypertext?


Ans: Hypertext is the web content or normal text written in HTML,used to create link in web pages.When
ever you click over a hypertext this will allow you to move to the new web content which is linked.
Ques:8) What are the elements and Tags in HTML?
Answer: Elements give structure to a HTML document and tell the browser how a website to be presented.
A html document consist many tags they may be starting and ending tags and tags are represented as " < "
or " > " .
Example <html> </html> , some times properties are used with tags as well.

Ques:9)What is container tag and empty tags in HTML?


Answer: Tags are of two types in HTML:
A) container tag B) Empty tag
A tag is said to be container tag or paired tag if it consist of starting tag and ending tag. content is placed
between these tags Example: <h1> hello class </h1>
A tag is said to be empty tag if it does'nt contain any paired or companion tag. Empty tags are also known
as singular tag or stand-alone tag. Example: <br> <hr>

Ques1)How to set the background color of a Web document in HTML?


Ans:In order to change the background color of the web page you can use "bgcolor" attribute in <body>
Tag.
Example: <body bgcolor="color_name">
you can also use hexa decimal colour code as colour name.Ex: <body bgcolor="#00aa00">

Ques2:-How to set the text color of a Web document in HTML?


Ans:In order to change the text color of the web page you can use "text" attribute in <body> Tag.
Example: <body text="color_name">
you can also use hexa decimal colour code as colour name.
Ex: <body text="#colour code">.
By using this attribute the entire page text color will change. Only font tag not effected.

Ques3:How to set margins in the HTML document?


Ans:Margins refers the white space present in the web page. You can setup margins in the web document.
There are four types of margins: LEFT, RIGHT, TOP and BOTTOM.
EX:- <body margin_name ="value">
<body leftmargin=25>
This will create a margin of the 25 pixels in the document as left sided. Same as you can set rest of all.

Ques4:What is heading tag in HTML?


Ans: Heading tags are used to add heading in the document. There are 6 different heading tags are available
in HTML. starting from <H1> to <H6> .
<H1> create the heading in biggest size whereas <H6> is used for lowest level.
Example: <H1> My project </H1>
" My Project " will be displayed as Heading.

Ques5:What is <HR> tag, also define its attributes?


Ans:<HR> tag is used to create a "horizontal rule" in web document. You can divide a web document in
sections , using <hr> tag. <HR> tag accept different attributes as (color, size, shade,width,align).
Ex: create a Line in web page having color green, size 4 and width 250.
<HR color=green size=4 width=250>
This tag is singular tag, Hence no need to close.
Size : determine thickness of HR, width define its width , where as align is used to align the HR in document
may be left, right , center.

Ques1)What is Paragraph tag in HTML?


Ans:In HTML you can use <P> tag to create a paragraph in HTML. You can create multiple paragraph in your
HTML document. By Using <P> tag ,it creates a space between two different paragraph.
You can use align attribute with paragraph tag as:
Example: <p align=right>
<P> tag is a container tag . Hence need to be closed.

Ques2:-What is Font tag in HTML? with example.


Ans:The <font> tag is used to define a font type, size and its colour for the specific text or element on a web
page. <font> tag have the following attributes:
A)color attribute: To specify color of the text in web page.
B)size attribute:To specify size of the text in web page.
C)face attribute: To specify style of the text in web page.

Ques3:Define the following Tags in HTML?


Ans:<U> tag: It is used to underline the specify text.
<I> tag: It is used to make the specify text in italic form.
<B> tag: It is used to make the specify text bold.
<strike> tag: This tag is used to make a text strike horizontally.
<BIG> tag: This tag is used to make the size bigger than other one.
<SMALL> tag: This tag is used to make the size smaller than rest of the text.
<SUP> tag: It is used to define the super script text. A super script is a symbol or a character that appears
slightly above the line.
<SUB> tag: It is used to define the sub script text. A sub script is a symbol or a character that appears slightly
below the line.

Q1)What do you understand by HTML List, also discuss its types?


Ans: In HTML you can organize your work in a listed manner.You can create a list by using <ol>, <ul> or <DL>
tag.There are three kinds of list in HTML A) Unordered list B)ordered list C) definition List

Q:2) What is unordered list?Give example.


Ans:The term unordered list means items are shown in a list but not in a listed manner. The list begins or
end with <UL> and </UL> tag. In the list each item is added by <li> tag "list item". Example of unordered
list is
<html>
<head>
<title>unordered list</title>
</head>
<body>here is a list of items required for the project
<ul>
<li>pencil</li>
<li>pen</li>
<li> paper</li>
</ul>
</body>
</html>

Q:3)What is ordered list in HTML?Give example.


Ans: The ordered list is also known as Numbered list , is also similar as unordered list. But the list is present
in the form of numbering or in an ordered.the opening tag for the list is <OL> and ending tag for the list is
</OL> tag.Example of ordered list is
<html>
<head>
<title>ordered list</title>
</head>
<body>here is a list of items required for the project
<ol>
<li> pencil</li>
<li>pen</li>
<li> paper</li>
</ol>
</body>
</html>

Q:4)What is definition list in HTML?


Ans: A definition list (coded as <DL>) usually consist of alternating a definition term (coded as <DT>) and a
data description (coded as <DD>).
Example of Definition list
<html><head>
<title>the nested list</title>
</head><body>example of definition list
<dl>
<dt>tiger</dt>
<dd>our national animal</dd>
<dt>Pranab Mukherjee</dt>
<dd>president of india</dd>
</dl></body></html>

Ques5 :How to change the type of a list?


Ans: You can also change the type of a list by using type attribute in list. For example you want to change
the type of a <ol> you can use the following attribute as
Ex: <OL type=A>
This example will create a list, having serial number begin from A, B, C....
same as you can use Type=i,I,1,a for orderlist and Type=disc, circle and square for unorder list.
Q:1)What do you understand by hyperlinks in HTML?
ans: A web page is linked with another one, using the link is called hyperlink. HTML uses the <a> anchor tag
to create a link to another document.To add a link you will use the <a href=" location of document">
opening tag</a> closing tag.

Ques:2) what is HREF attribute in HTML?


Ans:HREF stands for "Hyper REFerence", which is another way of saying, "the location of the file that I want
to load. most anchors are in the form of <A href ="URL"> , where URL is the location of the linked document.
Ex.<a href="http://www.google.com>visit google</a>

Ques3: How to create a links to mail in HTML?


Ans:Although links are usually used to send people to other web pages.you may also use links to send email
to a specific email address. This feature allow you to send email to a specific address to save time.
Ex. <a href="mailto:jaya1693@gmail.com"> contact us</a>

Ques4: What are the different attribute used with anchor tag?
Ans: <A> tag support different tags for different purpose you can use following attribute as:
title attribute : This attribute is used to provide the title of a link , when a user moves cursor over the link
it's shows the suitable title of the link.
target attribute: When a user want to redirect a webpage in a new tab , target attribute use with value
"blank" . This allow a link to open into a new Tab.
Example : <a href="school.html" title="school link" target="blank"> Click to show School details</a>

Ques5: What is alink,vlink attribute?


Ans: You can change the color of the link in HTML, using these attribute in Body tag.
Alink:A link is considered to be active when it's being clicked by user.
Vlink: A link is considered to be visited if user visit it.
Example: <body alink="green" vlink="red">

You might also like