MCQs / Computer Science / HTML Links, Images, Colours, Frames and Tables

HTML Links, Images, Colours, Frames and Tables MCQs — Computer Science (page 2)

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.

26. The hexadecimal code 0000FF represents:

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

Answer: D) blue

Explanation: Only the blue component is at maximum.

Discuss this question

27. Foreground colour refers to the colour of:

  1. the monitor frame
  2. the browser tab only
  3. text
  4. the page background

Answer: C) text

Explanation: Background is behind; foreground is the content/text.

Discuss this question

28. In <a href="https://www.hec.gov.pk"HEC</a, the clickable text is:

  1. href
  2. https
  3. HEC
  4. www.hec.gov.pk

Answer: C) HEC

Explanation: Only text between the tags is shown.

Discuss this question

29. A table header cell is defined with:

  1. <th
  2. <td
  3. <thead only
  4. <head

Answer: A) <th

Explanation: th text is bold and centred by default.

Discuss this question

30. In a frames page, which tag replaces the <body tag?

  1. <frameset
  2. <table
  3. <iframe
  4. <frame

Answer: A) <frameset

Explanation: frameset defines the layout.

Discuss this question

31. To merge two cells horizontally you use:

  1. rowspan="2"
  2. cellspacing="2"
  3. merge="2"
  4. colspan="2"

Answer: D) colspan="2"

Explanation: The cell spans two columns.

Discuss this question

32. The attribute of <a that specifies the destination is:

  1. alt
  2. link
  3. href
  4. src

Answer: C) href

Explanation: Hypertext reference.

Discuss this question

33. The attribute of the <body tag that sets the text (foreground) colour of the whole page is:

  1. text
  2. bgcolor
  3. face
  4. vlink

Answer: A) text

Explanation: <body text="white".

Discuss this question

34. Which frame attribute prevents users from resizing a frame?

  1. src
  2. scrolling
  3. name
  4. noresize

Answer: D) noresize

Explanation: <frame src="menu.html" noresize.

Discuss this question

35. Simple animated images on web pages are usually in:

  1. GIF format
  2. DOCX format
  3. MP3 format
  4. PDF format

Answer: A) GIF format

Explanation: GIF supports animation.

Discuss this question

36. Which tag order is correct for a table?

  1. <table → <td → <tr
  2. <tr → <table → <td
  3. <table → <tr → <td
  4. <td → <tr → <table

Answer: C) <table → <tr → <td

Explanation: Cells go inside rows, rows inside the table.

Discuss this question

37. A main disadvantage of frames is that:

  1. they are faster than all pages
  2. they are hard to bookmark and are obsolete in HTML5
  3. they cannot display text
  4. they need no HTML

Answer: B) they are hard to bookmark and are obsolete in HTML5

Explanation: Modern sites use CSS layouts instead.

Discuss this question

38. To open a link inside a frame named "content", you use:

  1. frame="content"
  2. name="content" on the link
  3. target="content"
  4. href="content"

Answer: C) target="content"

Explanation: target refers to the frame's name.

Discuss this question

39. The alt attribute of an image is used to:

  1. add a border
  2. align the image
  3. set the image width
  4. show alternative text if the image cannot be displayed

Answer: D) show alternative text if the image cannot be displayed

Explanation: It also helps screen readers and search engines.

Discuss this question

40. Which tag is used to embed another web page inside a page in HTML5?

  1. <frameset
  2. <iframe
  3. <window
  4. <embed-page

Answer: B) <iframe

Explanation: Inline frames are still valid in HTML5.

Discuss this question

41. The space between the content of a cell and its border is set by:

  1. cellspacing
  2. border
  3. cellpadding
  4. colspan

Answer: C) cellpadding

Explanation: Padding is inside the cell.

Discuss this question

42. Which image format supports transparency and is best for logos?

  1. PNG
  2. TXT
  3. BMP
  4. JPG

Answer: A) PNG

Explanation: PNG keeps transparent backgrounds.

Discuss this question

43. In <frameset rows="20%,", the means:

  1. a hidden frame
  2. 20% again
  3. the remaining space
  4. no frame

Answer: C) the remaining space

Explanation: The star takes whatever is left.

Discuss this question

44. Which attribute adds borders to a table?

  1. bgcolor
  2. border
  3. align
  4. caption

Answer: B) border

Explanation: border="1" shows grid lines.

Discuss this question

45. A table data cell is defined with:

  1. <tr
  2. <cell
  3. <tc
  4. <td

Answer: D) <td

Explanation: td = table data.

Discuss this question

Previous Page 2 of 2

Practise HTML Links, Images, Colours, Frames and Tables MCQs

More Computer Science chapters