HTML Questions and Answers - HTML5 Beyond Markup

1. How many levels of headings HTML has?
a) 6
b) 3
c) 7
d) 2

Answer: a
Explanation: HTML has six “levels ” of headings.<h1> is used for main headings,<h2> is used for subheadings. There is no other levels other than <h1>, <h2>, <h3>, <h4>, <h5>, <h6>

2. What is the size of content of an <h1> element?
a) Smallest
b) Largest
c) Medium
d) Anything between smallest and largest

Answer: b
Explanation: The contents of an <h1> element is the largest and the contents of an <h6> element is the smallest. Rest of <h2>, <h3>, <h4>, <h5> lies in between largest and smallest.

3. What is the tag used for making character appearance bold?
a) <b>content</b>
b) <i>content</i>
c) <u>content</u>
d) <br>content</br>

Answer: a
Explanation: By enclosing words in the tags <b>and</b> we can make characters appear bold. <i> element is for content in italics, <u> is for underlined content, <br> is for vertical breaking.

4. For writing chemical formula of water which tag will be used?
a) <sup>
b) <sub>
c) <br/>
d) <ul>

Answer: b
Explanation: The <sub> element is used to contain characters that should be subscript. It is commonly used with foot notes or chemical formulas. E.g. H20, <sup> is use for superscript, <br> is for horizontal break, <ul> is for unordered list.

5. which tag will be used For raising number to a power?
a) <sup>
b) <sub>
c) <br/>
d) <ul>

Answer: a
Explanation: The <sup> element is used to contain characters that should be superscript. It is commonly used with foot notes or chemical formulae. E.g. X2 , <br> is for break, <ul> is for unordered list.

6. What is the use of <hr/> tag?
a) To create horizontal rule between sections
b) To create a line break
c) To create vertical rule between sections
d) For making content appearance italics

Answer: a
Explanation: To create a break between themes-such as change of topic in a book or a new scene in a play-you can add a horizontal rule between sections using <hr/> tag

7. Which of the following is not an empty element.
a) <hr/>
b) <br/>
c) <sup>
d) <img/>

Answer: c
Explanation: There are a few elements that do not have any words between an opening and closing tag. They are known as empty elements. An empty element usually has only one tag. Before the closing angled bracket of an empty element, there will often be a space and a forward slash.

8. Which attribute is not essential under <iframe>?
a) src
b) height
c) width
d) frameborder

Answer: d
Explanation: An iframe is equivalent to a window that has been cut into our page, it is created using <iframe> element. Src, height, width attribute are essentially used inside of this. Src attribute specifies the URL of the page which is to be shown. Height and width specify the height and width of an iframe in pixels.

9. Copyright symbol can be included by _________
a) & lt
b) & copy
c) & amp
d) & gt

Answer: b
Explanation: HTML code has some characters that are reserved so for using those on the page one need to know “escape” characters. If you want to add a copyright symbol to the web page they can use & copy or & #169.

10. Attributes that allow to identify particular element are ___________
a) <div> and <span>
b) <meta>
c) id and class
d) <iframes>

Answer: c
Explanation: The id and class attributes are useful in identifying particular elements. <iframe> element is for creating frames in web page, <div> and <span> are inline elements, metadata is provided by <meta> tag.