HTML MCQs
1.What is HTML?
a)Hyper Text Marking Language b) Hyper Text Machine Language c)Hyper TextMiddle
Language d)Hyper Text Markup Language
2. We can add an ____ tag for inline frames.
a) <iframe> b) <framedset> c)<framename> d)<map>
3. The ____ element replicates asterisk for any keystroke.
a) password b) radio c) text d) checkbox
4. FTP Stands for ____________.
a) Field Transfer Protocol b)File Transfer Protocol c) FixTransfer Protocol d) Flexible Transfer
Protocol
5. Which tag is used to create a list that displays items with bullets?
a) <OL> b)<UL> c)<list> d)<DL>
6. Write a code for making text area?
a) <textarea> b) <input=”textarea”> c) <input type =”textbox”> d) <input type=”text area”>
7. For largest level of heading which tag is used?
a) <h1> b) <h6> c) <heading> d) <head>
8. Name some of the new features of HTML5.
HTML5 introduces a number of new elements and attributes that helps in building a modern
websites. Following are great features introduced in HTML5 −
• New Semantic Elements − These are like <header>, <footer>, and <section>.
• Forms 2.0 − Improvements to HTML web forms where new attributes have been
introduced for <input> tag.
• Canvas − This supports a two-dimensional drawing surface that you can program with
JavaScript.
• Audio & Video − You can embed audio or video on your web pages without resorting
to third-party plugins.
• Microdata − This lets you create your own vocabularies beyond HTML5 and extend
your web pages with custom semantics.
• Drag and drop − Drag and drop the items from one location to another location on a
same webpage.
9. What is Web Forms 2.0?
Web Forms 2.0 is an extension to the forms features found in HTML4. Form elements and
attributes in HTML5 provide a greater degree of semantic mark-up than HTML4 and remove
a great deal of the need for tedious scripting and styling that was required in HTML4.
10. What is the purpose of 'placeholder' attribute in HTML5?
HTML5 introduced a new attribute called placeholder. This attribute on <input> and
<textarea> elements provides a hint to the user of what can be entered in the field. The
placeholder text must not contain carriage returns or line-feeds.
11. What is the purpose of 'nav' tag in HTML5?
This tag represents a section of the document intended for navigation.
12. What is the purpose of 'aside' tag in HTML5?
This tag represents a piece of content that is only slightly related to the rest of the page.
13. What is the purpose of 'section' tag in HTML5?
This tag represents a generic document or application section. It can be used together with
h1-h6 to indicate the document structure.
14. Are HTML tags case sensitive?
No!
15. Is HTML5 backward compatible with old browsers?
Yes! HTML5 is designed, as much as possible, to be backward compatible with existing web
browsers. New features build on existing features and allow you to provide fallback content
for older browsers.
It is suggested to detect support for individual HTML5 features using a few lines of JavaScript.
16. If we don't want to allow a floating div to the left side of an element, which css property
will we use ?
A.margin
B.clear
C.float
D.padding
Answer: B
17. Suppose we want to arragnge five nos. of DIVs so that DIV4 is placed above DIV1. Now,
which css property will we use to control the order of stack?
A.d-index
B.s-index
C. x-index
D.z-index
Answer: D
18. If we want to wrap a block of text around an image, which css property will we use ?
A.wrap
B.push
C. float
D.Align
Answer: C
19. A small piece of program that can add interactivity to your website is called as
A. Meta
B. Script
C. Marquee
D. All of above
Answer: B
20. How do you display hyperlinks without an underline?
A. a {text-decoration:no underline}
B. a {decoration:no underline}
C. a {text-decoration:none}
D. a {underline:none}
Answer: C
21. How do you display a border like this:
The top border = 10 pixels
The bottom border = 5 pixels
The left border = 20 pixels
The right border = 1pixel?
A. border-width:10px 20px 5px 1px
B. border-width:10px 1px 5px 20px
C. border-width:5px 20px 10px 1px
D. border-width:10px 5px 20px 1px
Answer: B
22. When trying to access a URL, the following message is displayed on the browser:
Server; Error 403.
What could be the reason for the message?
a. The requested HTML file is not available
b. The path to the interpreter of the script file is invalid
c. The first line of the output from the script is not a valid HTTP header
d. The requested HTML file or CGI script has insufficient permission.
Answer: D
23. The elements <DIV> and <SPAN> have the following characteristics
a. Element <DIV> inherits properties defined for <SPAN> in a stylesheet
b. Elements <SPAN> and <DIV> define content to be inline or block-level
c. <DIV> and <SPAN> are used as alternatives for the element <P>
d. <DIV> is used inside element <P>.
Answer: B
24. How will you make all paragraph elements 'RED' in color ?
A.p.all {color: red;}
B.p.all {color: #990000;}
C.all.p {color: #998877;}
D.p {color: red;}
Answer: D
25. HTML(Hypertext Markup Language) has language elements which permit certain actions
other than describing the structure of the web document. Which one of the following actions
is NOT supported by pure HTML (without any server or client side scripting)pages?
A. Embed web objects from different sites into the same page
B. Refresh the page automatically after a specified interval
C. Automatically redirect to another page upon download
D. Display the client time as part of the page
Answer: D
26. Consider the HTML t able definition given below:
<table border=1>
<tr>
<td rowspan=2>ab</td>
<td colspan=2> cd </td>
</tr>
<tr>
<td>ef</td>
<td rowspan=2>gh</td>
</tr>
<tr><td colspan=2>ik</td>
</tr>
</table>
The number of rows in each column and the number of columns in each row are:
A(2, 2, 3) and (2, 3, 2)
B(2, 2, 3) and (2, 2, 3)
C(2, 3, 2) and (2, 3, 2)
D(2, 3, 2) and (2, 2, 3)
Answer: C
27. Which of the following is an advantage of putting presentation information in a separate
CSS file rather than in HTML itself?
AThe content becomes easy to manage
BBecomes easy to make site for different devices like mobile by making separate CSS files
CCSS Files are generally cached and therefore decrease server load and network traffic.
DAll of the above
Answer: D
28. In a web server, ten WebPages are stored with the URLs of the form
http://www.yourname.com/var.html; where, var is a different number from 1 to 10 for each
Webpage. Suppose, the client stores the Webpage with var = 1 (say W1) in local machine,
edits and then tests. Rest of the WebPages remains on the web server. W1 contains several
relative URLs of the form “var.html” referring to the other WebPages. Which one of the
following statements needs to be added in W1, so that all the relative URLs in W1 refer to the
appropriate WebPages on the web server?
A<a.href: “http://www.yourname.com/”, href: “...var.html”>
B <base href: “http://www.yourname.com/”>
C<a.href: “http://www.yourname.com/”>
D<base href: “http://www.yourname.com/”, range: “...var.html”>
Answer: B
29. Given below are several usages of the anchor tag in HTML.
<A HREF = "http://www.gate.ac.in/HTML/BASIC/testpage.html">Test Me</A>
<A HREF = "/BASIC/testpage.html">Test Me</A>
<A HREF = "testpage.html">Test Me</A>
<A HREF = "testpage.html#test">Test Me</A>
Which of the above are valid?
AI and II only
BI and III only
CI, II and III only
DI, II, III and IV
Answer: D
30. A HTML form is to be designed to enable purchase of office stationery. Required items are
to be selected (checked). Credit card details are to be entered and then the submit button is
to be pressed. Which one of the following options would be appropriate for sending the data
to the server. Assume that security is handled in a way that is transparent to the form design.
AOnly GET
B Only POST
CEither of GET or POST
DNeither GET nor POST
Answer: B
31. In XML, DOCTYPE declaration specifies to include a reference to __________ file.
A Document type Definition
BDocument type declaration
CDocument transfer definition
DDocument type language
Answer: A