MCQs / Computer Science / HTML Links, Images, Colours, Frames and Tables
HTML Links, Images, Colours, Frames and Tables MCQs — Computer Science 45 multiple-choice questions on HTML Links, Images, Colours, Frames and Tables 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 hexadecimal code for black is: 0000FF FFFFFF FF0000 000000 Answer: D) 000000
Explanation: All colour components are zero.
Discuss this question
2. A link written as href="contact.html" is a(n): email link absolute URL image tag relative URL Answer: D) relative URL
Explanation: It refers to a file in the same site/folder.
Discuss this question
3. The space between adjacent cells is set by: cellspacing width rowspan cellpadding Answer: A) cellspacing
Explanation: Spacing is between cells.
Discuss this question
4. The tag used to insert an image is: <src <pic <img <image Answer: C) <img
Explanation: <img is an empty tag.
Discuss this question
5. A table row is defined with: <td <th <row <tr Answer: D) <tr
Explanation: tr = table row.
Discuss this question
6. The frameset attribute that divides the window into vertical columns is: rows cols span width Answer: B) cols
Explanation: cols="30%,70%".
Discuss this question
7. To link to a section with id="fees" on the same page you write: <a href="fees" <a name="fees.html" <a href="fees" <a src="fees" Answer: C) <a href="fees"
Explanation: The refers to an id in the page.
Discuss this question
8. The body attribute used to set the colour of visited links is: link text vlink alink Answer: C) vlink
Explanation: v = visited.
Discuss this question
9. Frames divide the browser window into: multiple tables separate browsers a single paragraph multiple sections, each showing a separate page Answer: D) multiple sections, each showing a separate page
Explanation: Each frame loads its own HTML file.
Discuss this question
10. Which attribute opens a link in a new tab? target="blank" href="new" target="self" open="tab" Answer: A) target="blank"
Explanation: blank opens a new window/tab.
Discuss this question
11. The title of a table is given using: <th <title <head <caption Answer: D) <caption
Explanation: Caption appears above the table.
Discuss this question
12. A table with 3 <tr tags and 4 <td tags in each row has: 4 rows and 3 columns 3 rows and 4 columns 12 rows 7 columns Answer: B) 3 rows and 4 columns
Explanation: tr = rows; td per row = columns.
Discuss this question
13. Which code creates a link to send email? <a href="email:ali@uni.edu.pk" <a src="ali@uni.edu.pk"Email</a <a href="mailto:ali@uni.edu.pk"Email</a <mail to="ali@uni.edu.pk"Email</mail Answer: C) <a href="mailto:ali@uni.edu.pk"Email</a
Explanation: mailto: opens the email program.
Discuss this question
14. The attribute of the body tag used to set a background image is: bgimage src bgcolor background Answer: D) background
Explanation: <body background="bg.jpg".
Discuss this question
15. To merge three cells vertically you use: rowspan="3" colspan="3" height="3" span="3" Answer: A) rowspan="3"
Explanation: The cell spans three rows.
Discuss this question
16. The attribute that divides the window into horizontal sections is: rows align colspan cols Answer: A) rows
Explanation: rows="20%,".
Discuss this question
17. Which is the correct HTML to insert "logo.png" with a border of 2? <img src="logo.png" border="2" <image src="logo.png" border=2</image <img alt="logo.png" size="2" <img href="logo.png" border="2" Answer: A) <img src="logo.png" border="2"
Explanation: src gives the file and border the thickness.
Discuss this question
18. The attribute of <img that gives the image file path is: href alt link src Answer: D) src
Explanation: src = source.
Discuss this question
19. The attribute used to change the background colour of a page is: color face bgcolor text Answer: C) bgcolor
Explanation: <body bgcolor="...".
Discuss this question
20. Which attributes change the size of an image? border and align only href and target width and height src and alt Answer: C) width and height
Explanation: e.g. width="300" height="200".
Discuss this question
21. Which code makes an image clickable as a link? <a src="logo.png"index.html</a <a href="index.html"<img src="logo.png"</a <link img="logo.png" <img href="index.html" src="logo.png" Answer: B) <a href="index.html"<img src="logo.png"</a
Explanation: Put the img inside the anchor.
Discuss this question
22. A hyperlink is created with the: <a tag <link tag only <href tag <h1 tag Answer: A) <a tag
Explanation: a = anchor.
Discuss this question
23. By default, unvisited links are shown in: green red blue black Answer: C) blue
Explanation: Visited links are purple; active links are red.
Discuss this question
24. Which attribute gives a background colour to a single table cell? text in the <table tag face in the <td tag bgcolor in the <td tag color in the <tr tag only Answer: C) bgcolor in the <td tag
Explanation: <td bgcolor="yellow".
Discuss this question
25. Which code gives a navy background and white text to the whole page? <body bgcolor="navy" text="white" <font bgcolor="navy" <body text="navy" bgcolor="white" <body color="navy" Answer: A) <body bgcolor="navy" text="white"
Explanation: bgcolor = background, text = foreground.
Discuss this question
Page 1 of 2 Next
Practise HTML Links, Images, Colours, Frames and Tables MCQs
More Computer Science chapters