MCQs / Computer Science / Lab: HTML Web Pages
Lab: HTML Web Pages MCQs — Computer Science 42 multiple-choice questions on Lab: HTML Web Pages 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. In <a href="index.html"<img src="logo.png"</a, clicking the logo: downloads the logo does nothing opens an email opens index.html Answer: D) opens index.html
Explanation: The image works as a hyperlink.
Discuss this question
2. Which code opens HEC's website in a new tab? <a src="https://www.hec.gov.pk"HEC</a <a href="https://www.hec.gov.pk" target="blank"HEC</a <link href="hec"HEC</link <a href="https://www.hec.gov.pk" target="self"HEC</a Answer: B) <a href="https://www.hec.gov.pk" target="blank"HEC</a
Explanation: blank opens a new tab.
Discuss this question
3. The output of <pA<brB</p is: AB in bold A and B on the same line A and B on separate lines in one paragraph an error Answer: C) A and B on separate lines in one paragraph
Explanation: <br breaks the line.
Discuss this question
4. Text inside <th is displayed by default as: bold and centred underlined red italic and left aligned Answer: A) bold and centred
Explanation: Header cells are emphasised.
Discuss this question
5. In a definition list, the description of a term is written in: <dd <li <dt <dl Answer: A) <dd
Explanation: dd = definition description.
Discuss this question
6. In a table with 4 columns, if one cell uses colspan="2", how many <td tags are needed in that row? 2 3 4 5 Answer: B) 3
Explanation: One cell covers two columns.
Discuss this question
7. The default name commonly used for a website's home page file is: start.exe index.html home.txt main.doc Answer: B) index.html
Explanation: Web servers look for index.html first.
Discuss this question
8. <ol type="i" numbers items as: I, II, III i, ii, iii 1, 2, 3 a, b, c Answer: B) i, ii, iii
Explanation: Lowercase Roman numerals.
Discuss this question
9. The code <a href="news" links to: a website called news a file named news.exe an email address the element with id="news" on the same page Answer: D) the element with id="news" on the same page
Explanation: refers to an id on the page.
Discuss this question
10. In a frameset page, which attribute of <frame is used as a link target? noresize scrolling name src Answer: C) name
Explanation: Links use target="frame name".
Discuss this question
11. The <caption tag is placed: after </table immediately after the opening <table tag in the head section inside <td Answer: B) immediately after the opening <table tag
Explanation: Caption gives the table a title.
Discuss this question
12. The text written inside <title is displayed: nowhere on the browser tab as the first paragraph in the footer Answer: B) on the browser tab
Explanation: Title appears on the tab and in bookmarks.
Discuss this question
13. The modern HTML5 tag used to embed another page or a YouTube video inside a page is: <iframe <frameset <video-link <embedpage Answer: A) <iframe
Explanation: Inline frames are valid in HTML5.
Discuss this question
14. The <strike tag is used to show: blinking text text with a line through it superscript text underlined text Answer: B) text with a line through it
Explanation: e.g. an old price.
Discuss this question
15. After editing and saving the HTML file, to see changes in the browser you press: F5 (Refresh) F7 Ctrl + P F2 Answer: A) F5 (Refresh)
Explanation: The browser reloads the file.
Discuss this question
16. <ul type="circle" displays bullets as: filled squares letters numbers hollow circles Answer: D) hollow circles
Explanation: circle = ○.
Discuss this question
17. The tag that shows a message to browsers that do not support frames is: <noscript <noframes <frame <iframe Answer: B) <noframes
Explanation: Content inside noframes appears instead.
Discuss this question
18. The shortcut to view the HTML source of a page in most browsers is: Ctrl + H Ctrl + U Ctrl + S Ctrl + J Answer: B) Ctrl + U
Explanation: View page source.
Discuss this question
19. Which code displays CO₂ correctly? CO<sup2</sup CO<sub2</sub CO<big2</big CO<b2</b Answer: B) CO<sub2</sub
Explanation: Subscript lowers the 2.
Discuss this question
20. How many entities are needed to show 3 extra spaces? 0 3 6 1 Answer: B) 3
Explanation: One entity per space.
Discuss this question
21. Which program is suitable for writing HTML code? Calculator Notepad or VS Code MS Paint Windows Media Player Answer: B) Notepad or VS Code
Explanation: Any plain text editor works.
Discuss this question
22. Which body attribute sets a background picture? bgcolor background text link Answer: B) background
Explanation: <body background="bg.jpg".
Discuss this question
23. Which attribute merges a cell across 3 columns? merge="3" rowspan="3" colspan="3" span="3" Answer: C) colspan="3"
Explanation: colspan spans columns.
Discuss this question
24. The modern CSS property to change font colour is: fgcolor font-colour color text-colour Answer: C) color
Explanation: style="color:blue".
Discuss this question
25. Which code makes an ordered list begin at 10? <ul start="10" <ol start="10" <ol begin="10" <ol type="10" Answer: B) <ol start="10"
Explanation: start sets the first number.
Discuss this question
Page 1 of 2 Next
Practise Lab: HTML Web Pages MCQs
More Computer Science chapters