Professional Documents
Culture Documents
HTML Q&a
HTML Q&a
Explanation: The first version of HTML was written by Tim Berners-Lee in 1993.
Explanation: HTML tags are enclosed with <>. eg, paragraph tag is written as
5. Drag and drop feature is supported in
A. HTML5
B. HTML4
C. Both HTML4 and HTML5
D. It is not supported at all.
View Answer
Ans : A
6. What if one does not use the doctype in the starting of HTML
document?
A. Browser finds the document in quirky mode
B. Browser finds a document in standard mode
C. Browser stops working
D. Browser crashes after showing the page View Answer
View Answer
Ans : A
Explanation: If the browser finds <!doctype html> in the starting of an HTML document it
sets the document in standard mode but if one does not use a doctype, the browser goes to
quirky mode.
Explanation: <time> tag wrap single piece of information i.e. it defines date, month and
year.
8. The __________ attribute sets the text direction as related to the lang
attribute.
A. lang
B. sub
C. dir
D. ds
View Answer
Ans : C
Explanation: The dir attribute specifies the text direction of the element's content. List of
directory files is given by dir tag which is not supported in HTML5.
Explanation: To create HTML page, you need Web browser and text editor.
Explanation: Tim Berners-Lee is Known as the father of World Wide Web (WWW)
1. Choose the correct option.
A. Elements in HTML describes the way of presenting the content in the
browser.
B. All elements must have atleast one attribute associated with it.
C. Both a and b.
D. None of the above
View Answer
Ans : A
Explanation: Block element starts in a new line while inline elements start in the same line.
<html>
<body>
______
Johny Johny!
Yes Papa
______
</body>
</html>
Johny Johny!
Yes Papa
A. <p>
<p>
B. <pre>
</pre>
C. <s>
</s>
D. <b>
</b>
View Answer
Ans : B
Explanation: <pre> tag is used to retain the spaces as well as a new line of the content as it
is.
Explanation: HTML headings range from <h1> to <h6>,among which <h6> is the least
significant.
Explanation: HTML headings range from <h1> to <h6>,among which <h1> is the most
significant.
Explanation: All the above three statements are correct with respect to HTML tags.
10. Fill in the blank so that the browser display- Charge of elctron is
1.602x10^(-19) on exexcuting the HTML document?
<!DOCTYPE html>
<html>
<body>
__________________
</body>
</html>
Explanation: The content written between <sup> and </sup> gets superscripted.
1. How many core attributes that can be used on the majority of HTML
elements?
A. 1
B. 2
C. 3
D. 4
View Answer
Ans : D
Explanation: The four core attributes that can be used on the majority of HTML elements
(although not all) are : Id, Title, Class and Style
Explanation: The id attribute of an HTML tag can be used to uniquely identify any element
within an HTML page.
Explanation: True, The title attribute gives a suggested title for the element.
Explanation: There are three internationalization attributes, which are available for most
(although not all) XHTML elements : Dir, lang and xml:lang
5. The _________ attribute allows you to indicate to the browser about the
direction in which the text should flow.
A. lang
B. xml:lang
C. both a and b
D. dir
View Answer
Ans : D
Explanation: The dir attribute allows you to indicate to the browser about the direction in
which the text should flow.
Explanation: The xml:lang attribute is the XHTML replacement for the lang attribute. The
value of the xml:lang attribute should be an ISO-639 country code
Explanation: Region checkpoints are used to verify a displayed graphics. It is a kind of test
operation which gives verification of application’s window or control is displayed correctly or
not. Object’s property is verified by region checkpoints which is test operation. Local storage
is for storing data.
8. Which of the following does not lie under the attribute of <input> and
is not supported by Opera?
A. url
B. time
C. tel
D. option
View Answer
Ans : D
Explanation: <input> element type has new values as url, email, datetime, date, month, tel,
time, number, search, color, range, datetime-local, week.
Explanation: wrap is the attribute of <textarea> element and it indicates whether the text
should be wrapped. Syntax: <textarea wrap=""> if we use wrap=”hard” it will contain
newlines in the submission of a form. This attribute is newly introduced by HTML5 and is
supported by all the browsers.
10. The lang attribute allows you to indicate the main language used in a
document.
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, The lang attribute allows you to indicate the main language used in a
document, but this attribute was kept in HTML only for backwards compatibility with earlier
versions of HTML.
1. The _______ tag offers a way to structure your text into different
paragraphs.
A. h
B. p
C. p2
D. h5
View Answer
Ans : B
Explanation: The p tag offers a way to structure your text into different paragraphs.
2. You can use ___________ tag to put any content in the center of the page
or any table cell.
A. title
B. head
C. center
D. meta
View Answer
Ans : C
Explanation: You can use center tag to put any content in the center of the page or any
table cell.
Explanation: True, Horizontal lines are used to visually break-up sections of a document.
Explanation: hr tag is an example of the empty element, where you do not need opening
and closing tags, as there is nothing to go in between them.
Explanation: ul tag is used to create the unordered list items in an HTML document. By
default, unordered list items will display in a bulleted format.
Explanation: In HTML, tr tag is used to create a row in the table. tag is used to set the
header cell of a table.
7. Metadata does not define _________
A. character set
B. links
C. scripts
D. color
View Answer
Ans : D
Explanation: Metadata define character set, title of the document, links, styles, scripts and
other meta information.
Explanation: Relative URLs are used for linking other pages within the same site. These are
the shorthand version of absolute URLs. It does not need a domain name. These URLs are
helpful when building a site on a computer because we can create links between pages
without having set up for hosting or domain name.
Explanation: All the above three statements hold true for forms in HTML.
Explanation: All three options are true with reference to the GET method in HTML.
7. Which one of the following does not hold true regarding GET method
in HTML?
A. Use of GET method in HTML is more secured.
B. Use of GET method enables us to bookmark the page.
C. GET has size limitation.
D. None of the above
View Answer
Ans : A
Explanation: The use of the GET method is not secured as data sent will be visible in the
URL.
8. Which one of the following does not hold true regarding POST method
in HTML?
A. Use of POST method in HTML is more secured.
B. Use of POST method enables us to bookmark the page.
C. POST has no size limitation.
D. None of these.
View Answer
Ans : B
Explanation: The use of POST method for form submission does not allow to bookmark the
page.
10. How more than one option can be selected in drop down?
A. Use of multiple attribute inside <option> tag.
B. Use of multiple attribute inside <select> tag.
C. use of multiple attribute inside <text> tag.
D. It is not possible to select more than one option in drop down.
View Answer
Ans : B
Explanation: By the use of multiple attributes inside opening tag of <select>, more than one
option can be selected in dropdown.
Explanation: There are total six tags in HTML, which are used for defining headings
Explanation: <h1> is a heading tag which is used for adding a heading to a content
Explanation: In HTML, the content between the heading tags <h1> and </h1> has the
biggest size and it keeps on decreasing as we move towards <h6>.
Explanation: Both <p> and <h1> are block elements. None of them are inline.
<!DOCTYPE html>
<html>
<body>
<p>LetsFindCourse</p>
</body>
</html>
Explanation: The browser displays the content without tags and since <p> is a block
element, so it is displayed in the next line.
8. Fill in the blank from the given options in order to display the
paragraph in red colour font.
<!DOCTYPE html>
<html>
<body>
<p style="__________">LetsFindCourse</p>
</body>
</html>
A. color:red;
B. color=red;
C. text-color:red;
D. text-color=red;
View Answer
Ans : A
9. With respect to the HTML code given below, which line will have the
highest font size?
<!DOCTYPE html>
<html>
<body>
</body>
</html>
A. Heading 1
B. Heading 3
C. Heading 5
D. All of the above
View Answer
Ans : B
Explanation: The browser will modify the size of the fonts of headings as per the size given
in the attribute font-size.
10. On execution of below HTML code, size of World will be equal to size
of which HTML tag?
<!DOCTYPE html>
<html>
<body>
<h4><h2><h3><h1>World</h1></h3></h2></h4>
</body>
</html>
A. h1
B. h2
C. h3
D. h4
View Answer
Ans : A
Explanation: Property of the text World will be determined by the innermost tag i.e. <h1>
Explanation: href is used for defining destination address in <a> tag as <a href="destination
address">
Explanation: The address is specified as the value of href inside <a> tag of HTML and it can
be either absolute or relative.
4. Which one of the following value of target attribute opens the linked
url in a new tab?
A. _self
B. _blank
C. _top
D. _parent
View Answer
Ans : B
Explanation: <a href="link url" target="_blank"> opens the link url in a new tab.
5. What will the browser display for the above HTML code?
Explanation: The default value of the target is _self i.e. by default the linked URL will open
in the same tab.
Explanation: Link in HTML can be visited, unvisited or active. An unvisited link in HTML is
by default blue and underlined.
8. By default, the link in HTML is red and underlined when the link is-
A. visited
B. unvisited
C. Active
D. It is red and underlined.
View Answer
Ans : C
Explanation: Link in HTML can be visited, unvisited or active. A visited link in HTML is by
default purple and underlined.
<!DOCTYPE html>
<html>
<body>
<ul _____________>
<li>
Physics
</li>
<li>
Chemistry
</li>
<li>
Mathematics
</li>
</ul>
</body>
</html>
A. style="list-style-type:square;"
B. style="list-type:square;"
C. style="type:square;"
D. style= "style:square;"
View Answer
Ans : A
Explanation: In order to determine the type of item marker in an unordered list of HTML, list-
style-type is used.
<!DOCTYPE html>
<html>
<body>
<ol _________>
<li>
Physics
</li>
<li>
Chemistry
</li>
<li>
Mathematics
</li>
</ol>
</body>
</html>
A. style= "type:i"
B. style= "list-style-type:i"
C. type= "i"
D. type= "small roman"
View Answer
Ans : C
Explanation: In the ordered list of HTML, type= "i" is used to number the ordered list with
small roman numbers.
6. In order to start a list from 10, what attribute should be added in the
opening tag of ordered list?
A. begin= "10"
B. start= "10"
C. style= "begin:10"
D. style= "start:10"
View Answer
Ans : B
Explanation: <ol start=10> will start numbering the items in the list from 10.
<!DOCTYPE html>
<html>
<body>
<dl>
____
Mathematics
____
____Calculus____
</dl>
</body>
</html>
A. <dd>,</dd>,<dt>,</dt>
B. <dt>,</dt>,<dd>,</dd>
C. <li>,</li>,<dd>,</dd>
D. <dt>,</dt>,<li>,</li>
View Answer
Ans : B
Explanation: This option will give the required output. Here <dt> is the description term and
is used to describe the description term.
8. In order to get a list without any item marker, which one of the
following can be used?
<!DOCTYPE html>
<html>
<body>
<dl>
____
Mathematics
____
____Calculus____
</dl>
</body>
</html>
Explanation: This option will remove the item marker and will simply display the elements of
the list without them.
Explanation: If the ordered list is written without any attribute, e.g <ol> , the list will start
from 1 by default.
Explanation: By default, the unordered list has disc as its item marker.
Explanation: Contents written between <table> and <table> are organised in the form of
table with the help of <tr>,<th> or <td> tags.
Explanation: Row in a table is defined using <tr>. The content written between <tr> and
</tr> is considered to be in single row.
Explanation: <th> is used for table header and it is by default bold and centered.
5. Fill in the blanks with the help of options given below in order to get
the following table when the below code is executed.
<!DOCTYPE html>
<html>
<body>
<table border="2">
<tr>
<th>Name</th>
<th>Phone no</th>
</tr>
<tr>
<td ______________>John</td>
<td>9898989898</td>
</tr>
<tr>
<td>9876543210</td>
</tr>
</body>
</html>
Name Phone no
John 9898989898
9876543210
A. colspan= "1"
B. colspan= "2"
C. rowspan= "1"
D. rowspan= "2"
View Answer
Ans : D
Explanation: rowspan is used to merge two or more rows into one. Since here rowspan=2,
so it will merge two rows into one.
6. In order to add space of 20px between cell content and its border of a
table in html, which one of the following option is appropriate?
A. th,td{ padding: 20px;}
B. table{ margin:20px; }
C. table{ border : 20px;}
D. table{ padding: 20px; }
View Answer
Ans : A
Explanation: In order to add space between contents and its border, we use padding.
8. Which one of the following can be used to define the spacing between
the cells of a table?
A. border-spacing
B. spacing
C. cell-spacing
D. table-spacing
View Answer
Ans : A
Explanation: By setting the value of border-spacing, we can adjust the spacing between the
cells of a table.
9. By default, the content written between and are placed at center. How
can it be put at left side of the cell of the table?
A. th{ align: left; }
B. th{ text-align: left; }
C. th { font-align:center; }
D. It cannot be done.
View Answer
Ans : B
10. Fill in the blanks with the help of options given below in order to get
the following table when the below code is executed.
<!DOCTYPE html>
<html>
<body>
<table border="2">
<tr>
<th>Name</th>
</tr>
<tr>
<td>John</td>
<td>9898989898</td>
<td>9876543210</td>
</tr>
</body>
</html>
Name Phone no
A. colspan= "1"
B. colspan= "2"
C. rowspan= "2"
D. rowspan= "2"
View Answer
Ans : B
Explanation: colspan is used to merge two or more columns into one. Since, here
colspan=2, so it will merge two columns into one.
Explanation: The meta tag defines metadata about an HTML document. Metadata is data
(information) about data.
2. meta tags always go inside the ________ element.
A. div
B. title
C. head
D. img
View Answer
Ans : C
Explanation: meta tags always go inside the head element, and are typically used to specify
character set, page description, keywords, author of the document, and viewport settings.
Explanation: Metadata will not be displayed on the page, but is machine parsable.
Explanation: Content : Specifies the value associated with the http-equiv or name attribute
Explanation: charset specifies the character encoding for the HTML document
Explanation: Valid values for the “CONTENT” attribute are: “INDEX”, “NOINDEX”,
“FOLLOW”, “NOFOLLOW”, “NOARCHIVE”. “NOREPEAT” is not any of robots meta tag.
Explanation: A charset attribute is new in HTML5. The charset is used to provide the
character support. The charset attribute specifies the character encoding which is in an
external script file.
Explanation: Metadata is used by browsers (how to display content or reload page), search
engines (keywords), and other web services.
Explanation: The tag also supports all the Global Attributes in HTML
Explanation: Microdata introduces five global attributes which would be available for any
element to use and give context for machines about your data.
Explanation: The groups are called items, and each name-value pair is a property.
Explanation: When the property value of a name-value pair added by an element with an
itemprop attribute which is a meta element then the value is the value of the element’s value
attribute, if it has one, or the empty string otherwise. The “itemprop” attribute is a global
attribute which adds properties to item.
8. The ___________ of an item is the value of its element’s itemid attribute.
A. token
B. typed item
C. global identifier
D. scope
View Answer
Ans : C
Explanation: The global identifier of an item is the value of its element’s itemid attribute, if it
has one, resolved relative to the element on which the attribute is specified. If the itemid
attribute is missing or if resolving it fails, it is said to have no global identifier. The “typed
item” creates new item.
Explanation: The “itemprop” attribute is a global attribute which adds properties to item.
When the property value of a name-value pair added by an element with an itemprop
attribute which is a data element then the value is the value of the element’s value attribute
if it has one, or the empty string otherwise.
Explanation: Yes, To add a property to an item, the itemprop attribute is used on one of the
item's descendants.
1. _________ is an application software that allows us to view and explore
information on the web.
A. HTML
B. web Browser
C. IDEs
D. Libraries
View Answer
Ans : B
Explanation: web Browser is an application software that allows us to view and explore
information on the web.
2. User can request for any web page by just entering a _________ into
address bar.
A. text
B. keyword
C. URL
D. All of the above
View Answer
Ans : C
Explanation: User can request for any web page by just entering a URL into address bar.
Explanation: Web browser can show text, audio, video, animation and more.
Explanation: A rendering engine is a software that draws text and images on the screen.
The engine draws structured text from a document (HTML, XML) and formats it properly
based on the given style declarations (CSS, XSL, etc). The primary job of a browser engine
is to transform HTML documents and other resources of a web page into an interactive
visual representation on a user’s device.
Explanation: The defer attribute is a boolean attribute. The script is executed after the page
has finished parsing. The defer attribute is used if and only if there is src attribute. Defer is
for external not internal scripts.
Explanation: In async attribute, the script is executed asynchronously with the rest of the
page (the script will be executed while the page continues the parsing). Defer, the Boolean
attribute is set to indicate to a browser that the script is meant to be executed after the
document has been parsed, but before firing DOMContentLoaded event. Older browsers
doesn’t support async attribute.
10. Interpreter receives the information from the controller and execute
the instruction line by line.
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: Yes, Interpreter receives the information from the controller and execute the
instruction line by line.
1. ___________ refers to the speed in which web pages are downloaded and
displayed on the user's web browser.
A. Web databases
B. Web performance
C. Web storage
D. Web data
View Answer
Ans : B
Explanation: Web performance refers to the speed in which web pages are downloaded and
displayed on the user's web browser.
Explanation: True, website optimization is the field of knowledge about increasing web
performance
Explanation: Web performance optimization improves user experience (UX) when visiting a
website and therefore is highly desired by web designers and web developers.
Explanation: Steve Souders coined the term "web performance optimization" in 2004
Explanation: 64% of any website’s page is made up of images. The loading speed of the
websites also slows down due to this much contribution of images in a web page. To reduce
this loading time we use web performance optimization.
Explanation: HTTP stands for Hypertext Transfer Protocol. For fetching, data from server
browser uses HTTP request, and in between client and host. The more HTTP request
slower the loading of a page will be.
Explanation: Gzip or deflate is partially supported by Netscape 4.60+. Netscape 6+, IE 4+,
Opera 5+, Safari, Chrome, Lynx 2.6+ and Firefox fully support Gzip compression, IE 4.5
and 5 does not support Gzip compression, IE 5.5 and 6.0, IE 6.0 SPI, IE 6,7,8 partially
support Gzip compression.
Explanation: Web caches are located on either the client side (forward position) or web-
server side (reverse position) of a CDN.
1. ___________ refers to the speed in which web pages are downloaded and
displayed on the user's web browser.
A. Web databases
B. Web performance
C. Web storage
D. Web data
View Answer
Ans : B
Explanation: Web performance refers to the speed in which web pages are downloaded and
displayed on the user's web browser.
Explanation: True, website optimization is the field of knowledge about increasing web
performance
Explanation: Web performance optimization improves user experience (UX) when visiting a
website and therefore is highly desired by web designers and web developers.
Explanation: Steve Souders coined the term "web performance optimization" in 2004
Explanation: 64% of any website’s page is made up of images. The loading speed of the
websites also slows down due to this much contribution of images in a web page. To reduce
this loading time we use web performance optimization.
6. What is the maximum cache size for Chrome?
A. unlimited
B. 300 MB
C. 400 MB
D. 1024 MB
View Answer
Ans : B
Explanation: Maximum Cache size for Chrome is 300 MB, for Safari it is unlimited, For
Opera 10+ it is 400 MB, for Firefox 17 the maximum cache size is 1024 MB, for Internet
Explorer 6,7,8 it is 50 MB and for Internet Explorer maximum cache size is 250 MB.
Explanation: HTTP stands for Hypertext Transfer Protocol. For fetching, data from server
browser uses HTTP request, and in between client and host. The more HTTP request
slower the loading of a page will be.
Explanation: Gzip or deflate is partially supported by Netscape 4.60+. Netscape 6+, IE 4+,
Opera 5+, Safari, Chrome, Lynx 2.6+ and Firefox fully support Gzip compression, IE 4.5
and 5 does not support Gzip compression, IE 5.5 and 6.0, IE 6.0 SPI, IE 6,7,8 partially
support Gzip compression.
9. Does web caching optimization reduces server load, bandwidth usage
and latency?
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, Web Caching Optimization reduces server load, bandwidth usage and
latency.
Explanation: Web caches are located on either the client side (forward position) or web-
server side (reverse position) of a CDN.
Explanation: In #rrggbb, each three represents the intensity of red, green and blue colors
respectively.
3. Fill in the blanks from one of the options given below so that the
background of the paragraph is filled with color of color code #3cb371.
<!DOCTYPE html>
<html>
<body>
</body>
</html>
A. background-color:hex(#3cb371);
B. bg-color:hex(#3cb371);
C. background-color:#3cb371;
D. bg-color:#3cb371;
View Answer
Ans : C
Explanation: #3cb371 already reprsents that the color code is in HEX value. Writing hex
before the code is wrong.
4. #ffffff is equivqlent to which color in rgb color representation?
A. rgb(0,0,0)
B. rgb(100,100,100)
C. rgb(90,90,90)
D. rgb(255,255,255)
View Answer
Ans : D
Explanation: Since, the only rr is having #ff value and rest two are having 00, so the color
will be red.
Explanation: When all the three rr,gg,bb of #rrggbb have 00 value, it gives black color.
7. What is the total number of colors that can be represented using HEX
system in HTML?
A. 16^3
B. 16^6
C. 2^6
D. 2^16
View Answer
Ans : B
Explanation: Each digit of #rrggbb can have 16 values (from 0 to F) and there are total of 6
digits. Hence, the total number of possible colors=166.
9. Which of the following color codes of HTML represent the same color?
(i) #00ff00
(ii) hsl(120,100%,50%)
(iii) rgb(255,99,71)
A. All three.
B. i and ii
C. i and iii
D. ii and ii
View Answer
Ans : B
Explanation: i and ii represents color green while iii represents color tomato.
Explanation: Converting 255,99 and 71 into hexadecimal, we get ff,63 and 47 respectively.
Hence the equivalent color code will be #ff6347.
Explanation: h parameter in HSL represents the color in degrees which ranges from 0
degrees to 360 degrees.
Explanation: For the red color, the hue has a value of 00 value.
Explanation: For green color, the hue has a value of 120degree value.
Explanation: For blue color, the hue has a value of 240degree value.
Explanation: In hsl, s i.e. value of saturation is used for determining the intensity of the
color.
Explanation: 0% saturation gives the darkest shade of grey and their original color will not
be seen.
Explanation: The 0degree hue value is red. Moreover, it is 100% saturated and lightness is
also 50%. So, it will give a red color.
Explanation: All the three can be used for determining the color in HTML.
Explanation: RGB means the three basic colors Red, Blue, Green
Explanation: When all the three values are 0, it gives Black color.
Explanation: When all the three values are 255, it gives White color.
Explanation: In rgba, a stands for alpha which measures the degree of transparency.
Explanation: Since all the other two values are 0, so it will give the green color.
Explanation: All the above four represent different shades of grey color. The one having the
lowest intensity will be the darkest.