wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Grade 8 Computer Programming Quiz

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

What does HTML stands for?

a)

Hyper Text Markup Language

b)

Hyper Text Machine Language

c)

Hyper Text Markup Lessons

d)

Hyper Texture Markup Language

2.

The _____________ declaration defines that this document is an HTML5 document.

a)

<!DOCTYPE html:>    

b)

<:DOCTYPE html:>     

c)

<!DOCTYPE html>

d)

<!DOCTYPE html}>           

3.

A tag that specifies a group of one or more columns in a table for formatting.

a)

<caption></caption>

b)

<colgroup></colgroup>

c)

<table></table>

d)

<thead></thead>

4.

The _____________ element specifies a title for the HTML page (which is shown in the browser's title bar or in the page's tab).

a)

<head>                  

b)

<title>                    

c)

  <body>              

d)

<html>

5.

The _______ element is by default a block element, meaning that it takes all available width, and comes with line breaks before and after.

a)

<div>                     

b)

  <col>                                 

c)

<link>                      

d)

<foot> 

6.

The __________ element defines the document's body, and is a container for all the visible contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.

a)

<head>                 

b)

<title>                 

c)

      <body>              

d)

<html>

7.

The HTML ________ tag specifies an inline frame. An inline frame is used to embed another document within the current HTML document.

a)

<img>                    

b)

  <iframe>      

c)

           <form>                 

d)

<framset>

8.

_____ defines a thematic break in an HTML page and is most often displayed as a horizontal rule.

a)

<i>                        

b)

<p>          

c)


             <br>                

d)


<hr>

9.

Checkboxes let a user select ZERO or MORE options of a limited number of choices. The correct tags for checkboxes is ________________ .

a)

<input type="checkbox">                                 

b)

<input type=checkbox">

c)

<input type=checkbox>                              

d)

<input type="checkbox!>

10.

What is the correct HTML for adding a background color?

a)

<background>Yellow</background>                    

b)

<body style=background-color:yellow;”>               

c)

   <body bg=yellow>

d)

<body background=”yellow”>

11.

The correct tag in inserting image on your webpage is ____________ .

a)

<img></img>         

b)

<body></body>        

c)

<strong></strong>  

d)

<small></small>

12.

This element is useful for screen-reader users, because the screen-reader will read out loud the label when the user focus on the input element.

a)

Select

b)

Input

c)

Label

d)

Form

13.

The file extension of Graphics Interchange Format is ________ .

a)

<.apng>

b)

<.ico>

c)

<.gif>

d)

<.svg>

14.

The output element represents the result of a calculation (like one performed by a script) and the correct tags of this is _____________ .

a)

<output name="x" for="a b"></output>                   

b)

<input type="number" id="b"></input>            

c)

<output name="x" for="a b"><output>

d)

  <input type="number" id="b></input>

15.

The correct HTML tag for inserting an image with specified height is ______________________.

a)

<img src="img_girl.jpg"  height=600>

b)

<img src="img_girl.jpg"> 

c)

<img src="img_girl.jpg> 

d)

<img src="img_girl.jpg"  height=”600”>

16.

A file path describes a location of a file on a website folder structure and the correct tag is _____.

a)

<img src="images/picture.jpg">       

b)

<img src=img_girl.jpg"> 

c)

<img scr="img_girl.jpg> 

d)

<img scr="img_girl.jpg"  height=”600”>

17.

These tags help organize content hierarchically and improve accessibility. Which of the following HTML tags is used to define the least important heading on a webpage?

a)

<h1>           

b)

          <h3>                    

c)

  <h6>                 

d)

<h4>

18.

Inline styles are applied directly within an HTML tag using the style attribute. Which of the following is the correct way to apply an inline style that changes the text color to blue in HTML?

a)

<p style="color:blue;">This is a paragraph.</p>

b)

<p >This is a paragraph.</p>

c)

<p >This is a paragraph.</p>

d)

<p >This is a paragraph.</p>

19.

When rendered in most browsers, it automatically adds quotation marks around the quoted text. Which HTML tag is used to define a short inline quotation?

a)

<quote></quote>                                                 

b)

<blockquote></blockquote>                               

c)

<q></q>

d)

<cite></cite>

20.

The picture element is used to group multiple images for responsive design. It allows you to specify different images for different screen sizes using the tag.Which HTML element is used to group multiple images for responsive design?

a)

<img> tag           

b)

<picture> tag                     

c)

<figure> tag                   

d)

<div> tag

21.

The style attribute is used to apply inline CSS directly to an HTML element. Which of the following is the correct way to set the text color to red using HTML?

a)

<p style="font-color:red;">This is a paragraph.</p>

b)

<p style="color:red;">This is a paragraph.</p>

c)

<p style="text-color:red;">This is a paragraph.</p>

d)

<p style="background-color:red;">This is a paragraph.</p>

22.

The bold tag makes text bold purely for visual emphasis, without implying importance. Which HTML tag is used to make text bold?

a)

<strong></strong>          

b)

<b></b>             

c)

 <bold></bold>                

d)

<em></em>

23.

The superscript tag renders text as superscript, which is useful for mathematical expressions or footnotes. From the list below, which of the following is the correct tags?

a)

<sup></sup>      

b)

   <sub></sub>          

c)

<super></super>             

d)

<script></script>

24.

Hyperlinks are one of the most essential features of HTML, allowing users to navigate between web pages or resources. Which of the following is the correct syntax for creating a hyperlink in HTML?

a)

<link href='https://example.com'>Visit Example</link>

b)

<url href='https://example.com'>Visit Example</url>

c)

<a href=”https://example.com”>Visit Example</a>

d)

<href='https://example.com'>Visit Example</href>

25.

HTML tables are used to organize data into rows and columns.Which of these elements are all

elements?

a)

<table><tr><td>

b)

<table><head><tfoot>

c)

<table><tr><tt>

d)

<thead><body><tr>

26.

The src attribute is used to specify the path or URL of the image file in the tag.Which of the following attribute listed below is used to specify the path of the image file in the tag?

a)

alt

b)

path

c)

src

d)

href

27.

The pre tag displays text exactly as written in the HTML file, including spaces and line breaks. Which HTML tag preserves both spaces and line breaks in the displayed text?

a)

<code></code>         

b)

<text></text>

c)

<format></format>   

d)

<pre></pre>

28.

The input tag is used to create a text field for user input. Which HTML tag is used to create a text field for user in order for them to input a text on a webpage?

a)

<input>

b)

<textarea>     

c)

<textfield>     

d)

<form>

29.

Checkboxes in HTML are used to allow users to select one or more options from a set. Which of these tag is correct HTML for making a checkbox?

a)

<input type=”check”>

b)

< input type =check>

c)

<input type=”checkbox>

d)

<input type=”checkbox”>

30.

The placeholder attribute is used to specify the text that appears inside the text field as a hint to the user. Which attribute is used to pre-fill a text field with a default value when the user try to input the text?

a)

Value

b)

Default

c)

Placeholder

d)

Prefill

31.

The required attribute is used to make a text field mandatory for form submission, if the field is left empty, the form will not be submitted. Which attribute is used to make a text field mandatory for form submission?

a)

Required

b)

Mandatory

c)

Validate

d)

Mustfill

32.

The 'rel' attribute is set to 'icon' and the 'href' attribute specifies the path to the favicon file. Which HTML tag is used to define a favicon for a webpage?

a)

The <link> tag

b)

The <icon> tag

c)

The <favicon> tag

d)

The <head> tag

33.

HTML document is use to ensure that the code is loaded before the page content.Which part of the HTML document should the tag for a favicon be placed?

a)

It is anywhere in the document

b)

In the <body> section

c)

At the end of the document

d)

In the <head> section

34.

The maxlength attribute is used to limit the maximum number of characters that can be entered in a text field. How can you limit the maximum number of characters in a text field?

a)

By using the maxlenght tag to limit the number of characters

b)

By limiting the availbale spaces in the designed webpage.

c)

By using the maxchars to come up the desired output.

d)

By using the tag <charlimit> for the bright outputs and interactive site.

35.

The width attribute is used to specify the width of an image in HTML. It can be set in pixels or as a percentage. How will you specify the width of an image in HTML?

a)

By using the size attribute in the HTML tag.

b)

By using the width attribute in an HTML tag.

c)

By Using the dimensions attribute in an HTML tag.

d)

By using the scale attribute for the image to become fitted.

36.

Understanding how to customize these lists not only improves readability. How can you change the numbering style of an ordered list in HTML?

a)

By using the style attribute in the

  • <li> tag.

b)

By using the id attribute in the

  • <ol> tag

c)

By using the class attribute in the

  1. <li> tag.

d)

By using the type attribute in the

  1. <ol> tag.

37.

Ordered lists in HTML are used to display items in a sequential order, typically numbered. How do you nest an ordered list inside another ordered list in HTML?

a)

By using the <ul>  tag inside another <ol> tag

b)

By using the <li> tag inside another <li> tag.

c)

By using the <ol>  tag inside another <ol> tag.

d)

By using the <list> tag inside another <list> tag.

38.

HTML forms are a fundamental part of web development, enabling user interaction and data collection. How can you specify where to send form data after submission?

a)

By using the action attribute in the

<form> tag.

b)

By using the method attribute in the

<form> tag.

c)

By using the target attribute in the

<form> tag.

d)

By using the name attribute in the

<form> tag.

39.

These attributes define how the form behaves, where the data is sent, and how it is processed. How can you specify the HTTP method used to submit form data?

a)

It is through using the method attribute.

b)

It is through using the target attribute.

c)

It is through using the action attribute.

d)

It is through using the enctype attribute.

40.

How can you enable autocomplete for form fields?

a)

By using the autocomplete attributes in the form fields.

b)

By using the autofill attribute to complete the attibutes.

c)

By using the automcompletion attributte,

d)

By using the auto-focus attribute.

41.

HTML provides powerful tools for embedding and controlling media content such as audio, video, and images directly within web pages. How can you add controls to an HTML video element?

a)

By using the loop attribute.

b)

By using the autoplay attribute

c)

By using the muted attribute

d)

By using the controls attribute

42.

In the early days of web design, the <marquee> tag was used to create scrolling text or images on a webpage. Why is the <marquee> tag considered outdated in modern HTML standards?

a)

Because it is not sopported by all browsers.

b)

Because it is not responsive and does not follow accessibility guidelines.

c)

Because it has been replaced by the <blink> tag.

d)

Because it consumes too much memory.

43.

The class attribute is a powerful tool used to group elements for styling and scripting purposes. How does the class attribute enhance the styling of HTML elements?

a)

It allows elements to be hidden from the browser.

b)

It enables the use of inline styles only.

c)

It automatically changes the font of all elements.

d)

It groups elements under a common name for CSS styling and JavaScript manipulation.

44.

The <iframe> tag in HTML is used to embed another HTML document within the current webpage. How can you set the height of an <iframe> in HTML?

a)

By using the height attribute within the <iframe> tag.

b)

By using the src attribute within the <iframe> tag.

c)

By wrapping the <iframe> in a <div> and setting the height of the <div>.

d)

By using the alt attribute within the <iframe> tag.

45.

The <footer> tag in HTML is used to define the footer section of a webpage or a specific section. How can the <footer> tag improve the semantic structure of a webpage?

a)

By adding a navigation bar to the top of the page, such as copyright and contact information.

b)

By automatically styling the footer with default CSS rules, such as copyright and contact information.

c)

By embedding multimedia content like videos and images, such as copyright and contact information.

d)

By providing a dedicated section for footer-related content, such as copyright and contact information.

46.

HTML frames were used in earlier versions of HTML to divide a webpage into multiple sections, each capable of displaying a separate HTML document. How can you define multiple sections of a webpage using HTML frames?

a)

By using the <iframe> tag.

b)

By using the <frameset> and <frame> tags.

c)

By using the <section> and <article> tags.

d)

By using the <div> tag with CSS styling.

47.

Radio buttons in HTML are used to allow users to select one option from a group of choices. How can you ensure that only one radio button can be selected at a time in HTML?

a)

By giving each radio button a unique id attribute.

b)

By using the type="checkbox" attribute instead of type="radio".

c)

By enclosing the radio buttons in a

<div> tag.

d)

By grouping radio buttons with the same name attribute.

48.

A favicon is a small icon displayed in the browser tab, bookmarks, or address bar, representing a website. How can you add a favicon to a webpage using HTML?

a)

By using the <img> tag in the <body> section.

b)

a.   By embedding the favicon directly using the <style> tag.

c)

By linking the favicon file with the <link> tag in the <head> section.

d)

By placing the favicon file in the root directory without any HTML reference.

49.

How many attributes does a table tag in HTML?

a)

8

b)

6

c)

14

d)

10

50.

How many core attributes does an image tag have?

a)

6

b)

8

c)

4

d)

2