MCQs / Computer Science / HTML Basics: Structure, Text Formatting and Lists

HTML Basics: Structure, Text Formatting and Lists MCQs — Computer Science

57 multiple-choice questions on HTML Basics: Structure, Text Formatting and Lists from Computer Science, each with the correct answer and, where available, a teacher's explanation. Read through them to revise the chapter, then practise the same questions one by one to test yourself.

1. The tag for a paragraph is:

  1. <pg
  2. <p
  3. <para
  4. <br

Answer: B) <p

Explanation: <p creates a paragraph.

Discuss this question

2. Which type value gives square bullets in an unordered list?

  1. square
  2. circle
  3. A
  4. disc

Answer: A) square

Explanation: type="square".

Discuss this question

3. <!DOCTYPE html tells the browser that:

  1. the page is a Word file
  2. the document is an HTML5 document
  3. the page has no head
  4. the page is an image

Answer: B) the document is an HTML5 document

Explanation: It is a declaration, not a tag.

Discuss this question

4. HTML was created by:

  1. Bill Gates
  2. Charles Babbage
  3. Tim Berners-Lee
  4. Dennis Ritchie

Answer: C) Tim Berners-Lee

Explanation: He created HTML along with the WWW.

Discuss this question

5. Text inside the <title tag appears:

  1. as a large heading on the page
  2. on the browser tab / title bar
  3. nowhere at all
  4. at the bottom of the page

Answer: B) on the browser tab / title bar

Explanation: It names the page in tabs and bookmarks.

Discuss this question

7. To display the symbol < on a web page you should write:

  1. &lt;
  2. &gt;
  3. &amp;
  4. &nbsp;

Answer: A) &lt;

Explanation: &lt; = less than.

Discuss this question

8. To write H₂O in HTML you use:

  1. <sup
  2. <strike
  3. <small only
  4. <sub

Answer: D) <sub

Explanation: Subscript lowers the 2.

Discuss this question

9. A list placed inside another list item is called a:

  1. frame
  2. definition list
  3. nested list
  4. table

Answer: C) nested list

Explanation: Lists can contain sub-lists.

Discuss this question

10. HTML stands for:

  1. HyperText Markup Language
  2. Hyperlink Tool Markup Language
  3. HyperText Machine Language
  4. High Text Making Language

Answer: A) HyperText Markup Language

Explanation: HTML is used to create web pages.

Discuss this question

11. The range of values for the size attribute of <font is:

  1. 0 to 100
  2. 1 to 7
  3. 8 to 72
  4. 1 to 10

Answer: B) 1 to 7

Explanation: Default size is 3.

Discuss this question

12. The extension of an HTML file is:

  1. .html or .htm
  2. .exe
  3. .doc
  4. .xls

Answer: A) .html or .htm

Explanation: Browsers open .html files.

Discuss this question

13. Which code displays "E = mc²" correctly?

  1. E = mc<sup2</sup
  2. E = mc<sub2</sub
  3. E = mc<u2</u
  4. E = mc<b2</b

Answer: A) E = mc<sup2</sup

Explanation: The 2 must be a superscript.

Discuss this question

14. The <center tag is used to:

  1. make text bold
  2. align content in the centre of the page
  3. create a list
  4. insert an image

Answer: B) align content in the centre of the page

Explanation: It is deprecated in HTML5 (use CSS).

Discuss this question

15. HTML is a:

  1. programming language with loops
  2. operating system
  3. database
  4. markup language

Answer: D) markup language

Explanation: It structures content with tags.

Discuss this question

16. HTML tags are enclosed in:

  1. square brackets [ ]
  2. round brackets ( )
  3. angle brackets <
  4. curly braces

Answer: C) angle brackets <

Explanation: e.g. <p.

Discuss this question

17. All visible content of a web page is written in the:

  1. <head section
  2. <body section
  3. <title tag
  4. DOCTYPE

Answer: B) <body section

Explanation: The body holds visible content.

Discuss this question

18. The attribute of the <font tag that changes the typeface is:

  1. style only
  2. type
  3. font-name
  4. face

Answer: D) face

Explanation: e.g. face="Arial".

Discuss this question

19. The <br tag is used to:

  1. start a list
  2. insert a line break
  3. create a border
  4. make text bold

Answer: B) insert a line break

Explanation: It moves text to the next line.

Discuss this question

20. <ol type="I" numbers the list items as:

  1. A, B, C
  2. I, II, III
  3. 1, 2, 3
  4. a, b, c

Answer: B) I, II, III

Explanation: Uppercase Roman numerals.

Discuss this question

21. The colour code FF0000 represents:

  1. white
  2. blue
  3. red
  4. green

Answer: C) red

Explanation: RR=FF, GG=00, BB=00.

Discuss this question

22. Which is the correct way to write a comment in HTML?

  1. <!-- comment --
  2. / comment /
  3. // comment
  4. comment

Answer: A) <!-- comment --

Explanation: HTML comments are not displayed.

Discuss this question

23. The largest heading tag is:

  1. <h6
  2. <heading
  3. <head
  4. <h1

Answer: D) <h1

Explanation: h1 is the biggest and most important.

Discuss this question

24. The latest major version of HTML is:

  1. XHTML 0.5
  2. HTML5
  3. HTML2
  4. HTML 3.2

Answer: B) HTML5

Explanation: HTML5 is the current standard.

Discuss this question

25. Which tag displays "Hello" in blue Arial font of size 5?

  1. <font color="5" size="blue" face="Arial"Hello</font
  2. <text size="5" color="blue"Hello</text
  3. <font size="5" color="blue" face="Arial"Hello</font
  4. <font face="5" color="Arial"Hello</font

Answer: C) <font size="5" color="blue" face="Arial"Hello</font

Explanation: size, color and face attributes are used correctly.

Discuss this question

Page 1 of 3 Next

Practise HTML Basics: Structure, Text Formatting and Lists MCQs

More Computer Science chapters