HTML Questions & Answers – Numbered, Bullet and Definition Lists

This set of HTML Multiple Choice Questions & Answers (MCQs) focuses on “Numbered, Bullet and Definition Lists”.

1. Which tag is used for List items?
a) <li>
b) <ol>
c) <ul>
d) <dl>
View Answer

Answer: a
Explanation: li is for the list items. The list is indented by default by the browser. <li> is written inside <ol> element having opening <li> tag and closing </li> tag. Sometimes <ol> can also include type attribute which defines type of numbering. <ol> represents a ordered list where as <ul> is unordered list. A description list is specified by <dl> tag.

2. Which element contains definition?
a) <dl>
b) <dd>
c) <dt>
d) <ul>
View Answer

Answer: b
Explanation: <dd> element is used to contain definition. The definition list is created by using <dl> element. Inside <dl> element we can have pairs of <dd> and <dt> elements. <dt> contains the term being defined. <ul> is unordered list. A description list is specified by <dl> tag. <dt> tag is a term in description list.

3. Which of the following can’t be the value of list-style-type?
a) square
b) circle
c) ellipse
d) disc
View Answer

Answer: c
Explanation: list-style-property is used for defining the style of list item marker. Its value can be square, circle, disc or none. For setting list item marker to be bullet we use the value disc. It is the default value. For setting list item marker to a circle we used the circle, for setting it to be square we set the value square. If we set the value none, list items will not be marked.
advertisement
advertisement

4. For displaying a list horizontally, we can use ______________
a) <dd>
b) display:inline
c) <dt>
d) type
View Answer

Answer: b
Explanation: If we want to display the list horizontally we can use display:inline or float:left. It will create a menu. E.g. ul {list-style-type: none; padding:0; overflow:hidden; } li {float:left} li g{ display: block; color:red; padding: 20px;}. <dd> element is used to contain definition. <dt> tag is a term in description list.

5. Which attribute is only used with <ol>?
a) value
b) type
c) compact
d) start
View Answer

Answer: d
Explanation: The number attribute is only used with <ol>. The starting number of the first item in an ordered list is specified by this attribute. The default number for starting is ‘1’. The corresponding labels can be non numeric even its value is set to numeric. The “start” and “type” attribute are removed from HTML4.01 but can be still used in HTML5 where as “compact” attribute is not used in HTML5.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. Which element is restricted to inline content?
a) <dt>
b) <dd>
c) <ul>
d) <dl>
View Answer

Answer: a
Explanation: <dt> element is restricted to inline content. In creation of a definition list the term is given by <dt> element. <dd> element contains block-level content. The description is given by <dd> element. <dl> is also used for marking up the dialogues.

7. Which element was designed for creating multicolumn directory lists?
a) menu
b) dir
c) ul
d) ol
View Answer

Answer: b
Explanation: For the creation of multicolumn directory lists dir element was designed. For designing a single column menu list menu element was designed. They have the same structure as ul. It is just a different rendering. In practice, it works exactly as a ul list. <ol> represents a ordered list where as <ul> is unordered list. List of commands is defined by <menu> tag.
advertisement

8. The content property does not include __________
a) Strings
b) URIs
c) Normal
d) Color
View Answer

Answer: d
Explanation: The content property includes Strings, URIs, Normal, None, Image, Counter and many more. When we are using these characters it is essential to encode them as their escaped HEX equivalents. These characters will work i.e. will only be visible in Mozilla/Netscape or in Opera.

9. Which character is used to differentiating between choices to list items?
a) ‘|’
b) ‘>’
c) ‘#’
d) ‘$’
View Answer

Answer: a
Explanation: ‘|’, a pipe character is used to differentiate between choices. It is a separating character. It can be emulated by adding borders to list items. E.g. #pipe ul li.first {margin-left: 0; list-style: none; margin-left: none; display: inline; }. Here we have added class=”first” so that it does not end up with a border on the left side.
advertisement

10. Which of the following is not true regarding to counter?
a) counter(name,style)
b) counter(name)
c) counter(string)
d) counter(name,string,style)
View Answer

Answer: c
Explanation: There are two functions for specifying counters, ‘counter()’ or ‘counter()’. First one has two forms ‘counter(name,style)’ and ‘counter(name)’. The second one also has two forms ‘counter(name,string,style)’ and ‘counter(name,string)’.

11. Which property specifies the distance between nearest border edges of marker box and prinicipal box?
a) marker-offset
b) counter increment
c) list-style
d) list-style-image
View Answer

Answer: a
Explanation: We can create markers by setting ‘display’ property. It specifies the distance between nearest border edges of marker box and the principal box associated with it. It can be user specified i.e. <length> or can be chosen by ‘auto’. Length can be negative also. Counter increment increments counter by value 1. list- style specifies it’s three types: 1)life-style-image 2)life-style-position 3)life-style-type. The list-style-image defines an image to be used as list item’s marker. It is stated as life-style-type.

Sanfoundry Global Education & Learning Series – HTML.

To practice all areas of 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.