HTML Questions & Answers – Headings, Paragraphs, Tags & Linking between Pages

This set of HTML Questions & Answers for Exams focuses on “Headings, Paragraphs, Tags & Linking between Pages”.

1. For explaining, which new technology is used?
a) <dfn>
b) <cite>
c) <abbr>
d) <address>
View Answer

Answer: a
Explanation: When for the first time when we explain any new terminology like any jargon or any academic concept in the document we use <dfn> It is defining an instance of it. It is used for defining an instance of a new term. In some browsers, the content of <dfn> are shown in italics but in Chrome and Safari, nothing will be changed. Title of work is defined by <cite>. <abbr> is for abbreviation. Information about author or owner is provided by <address>.

2. Which element indicates about something which is no longer accurate?
a) <s>
b) <ins>
c) <del>
d) <address>
View Answer

Answer: a
Explanation: <s> indicates about something that is no longer relevant or accurate. It should also not to be deleted. The content of this element is displayed a line through the center. In older versions of HTML it had <u> element for the content to be underlined, but now it is no longer in use. Information about author or owner is provided by <address>. A text which has been inserted into a document is defined by a <ins>. <del> describes a text that has been deleted from a document.

3. Metadata does not define _________
a) character set
b) links
c) scripts
d) color
View Answer

Answer: d
Explanation: Metadata define character set, title of the document, links, styles, scripts and other meta information. E.g. <!doctype html> <html> <title> The Code </title> <meta charset= “UTF-8”> </head> <body>.
advertisement
advertisement

4. In HTML5 which element defines thematic change in the content?
a) <hr>
b) <h1>
c) <head>
d) <p>
View Answer

Answer: a
Explanation: For thematic change in the content <hr> tag is used. It is also used to separate content or for defining a change in any HTML page. All the browsers like Internet Explorer, Firefox, Opera, Chrome, Safari supports this element.

5. Which element defines preformatted text?
a) <p>
b) <pre>
c) <hr>
d) <ins>
View Answer

Answer: b
Explanation: <p> defines paragraph/text.


element is used for horizontal/thematic break. Preformatted test is defined by <pre> element. The text written inside this element will be displayed in fixed-width font. It also preserves line breaks and spaces. E.g.

 This is the first line.  </pre>.  A text which has been inserted into a document is defined by a <ins>.. 

6. Which element is used for creating links?
a) <a>
b) <p>
c) <li>
d) <ol>
View Answer

Answer: a
Explanation: <a> element is used for creating links. We can click anything written between opening <a> tag and closing </a> tag. E.g. <a href= “http://www.gmail.com”> GMAIL </a>. The text written between <a> and </a> is called link text. <p></p> defines paragraph. <li> specifies list of item. <ol> is ordered list which can be either numerically or alphabetically.

7. Relative URLs are used to ____________
a) link other pages within the same site
b) link the same page with other sites
c) link other pages with other sites
d) does not link
View Answer

Answer: a
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.
advertisement

8. What is the color of an unvisited link?
a) red
b) blue
c) purple
d) green
View Answer

Answer: b
Explanation: In all browsers by default the color of an unvisited link is blue. The color of a visited link is purple. The color of the active link is red. The link is underlined by default. E.g. www.google.com We can also change these default colors by the use of style.

9. Which one of the following is not the value of the target attribute?
a) _blank
b) _top
c) _self
d) _empty
View Answer

Answer: d
Explanation: Where to open linked document is specified by target attribute. It can have the values _blank, _top, _parent, _self, framename. _blank opens linked document is a new tab or window. The linked document is opened in the parent frame by _parent. Linked document is opened in a named frame by framename. Linked document is opened in the same window by _self.
advertisement

10. What is the path for an image located in same folder as the current page?

a) <img src= “pic.jpg”>
b) <img src= “../pic.jpg”>
c) <img src= “images/pic.jpg”>
d) <img src=/images/pic.jpg”>
View Answer
Answer: a
Explanation: The path <img src= “pic.jpg”> indicates that pic.jpg is located in same folder as current page. The path <img src= “images/pic.jpg”> indicates that pic.jpg is located in current folder. The path <img src= “/images/pic.jpg”> is located in images folder at root of current web. The path <img src= “../pic.jpg”> indicates that pic.jpg is located in folder one level up from current folder.
 
 
11. File paths are not used for linking in _________
a) JavaScripts
b) PHP
c) Style Sheets
d) Images
View Answer
Answer: b
Explanation: The location of a file in web site’s folder structure is described by file path. File paths are used for linking to external files like Images, JavaScripts, Web Pages, Style sheets. The full URL to internet file is an absolute file path.

12. For defining bookmarks in a page we use __________
a) href
b) id
c) target
d) <a>
View Answer

Answer: b
Explanation: id attribute is used for defining bookmarks in a page. For linking to the bookmark we use href attribute. Target attribute is used to define where to open a linked document. <a> element is used to define a link.

Sanfoundry Global Education & Learning Series – HTML.

To practice all exam questions on HTML, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.