wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML CSS Quiz

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

What does HTML stand for?

a)

Hyper Text Markup Language

b)

Hyperlinks and Text Markup Language

c)

Home Tool Markup Language

2.

Choose the correct HTML element for the largest heading:

a)

<h1>

b)

<h6>
c)

<head>

d)

<heading>

3.

What is the correct HTML element for inserting a line break?

a)

<br>

b)

<lb>

c)

<break>

4.

Which character is used to indicate an end tag?

a)

^

b)

*

c)

<

d)

/

5.

How can you open a link in a new tab/browser window?

a)

<a href="url" new>

b)

<a href="url" target="new">

c)

<a href="url" target="_blank">

6.

Which of these elements are all

elements?

a)

<table><tr><td>

b)

<thead><body><tr>

c)

<table><head><tfoot>

d)

<table><tr><tt>

7.

How can you make a numbered list?

a)

<list>

b)

<dl>

c)
  1. <ol>

d)
  • <ul>

8.

How can you make a bulleted list?

a)
  • <ul>

b)

<list>

c)

<ol>

d)

<dl>

9.

What is the correct HTML for making a checkbox?

a)

<input type="checkbox">

b)

<check>

c)

<input type="check">

d)

<checkbox>

10.

What is the correct HTML for making a text input field?

a)

<input type="textfield">

b)

<textfield>

c)

<input type="text">

d)

<textinput type="text">

11.

What is the correct HTML for making a drop-down list?

a)

<input type="dropdown">

b)
  • <list>

c)

<input type="list">

d)

<select>

12.

What is the correct HTML for making a text area?

a)

<input type="textarea">

b)

<input type="textbox">

c)

<textarea>

13.

What is the correct HTML for inserting an image?

a)

<img alt="MyImage">image.gif</img>

b)

<image src="image.gif" alt="MyImage">

c)

<img href="image.gif" alt="MyImage">

d)

<img src="image.gif" alt="MyImage">

14.

What is the correct HTML for inserting a background image?

a)

<body bg="background.gif">

b)

<background img="background.gif">

c)

<body style="background-image:url(background.gif)">

15.

An <iframe> is used to display a web page within a web page.

a)

There is no such thing as an <iframe>

b)

True

c)

False

16.

HTML comments start with <!-- and end with -->

a)

True

b)

False

17.

Which HTML element defines the title of a document?

a)

<meta>

b)

<title>

c)

<head>

18.

Which doctype is correct for HTML5?

a)

<!DOCTYPE html>

b)

<!DOCTYPE HTML5>

c)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5.0//EN" "http://www.w3.org/TR/html5/strict.dtd">

19.

Which HTML element is used to specify a footer for a document or section?

a)

<section>

b)

<footer>

c)

<bottom>

20.

In HTML, you can embed SVG elements directly into an HTML page.

a)

True

b)

False

21.

What is the correct HTML element for playing video files?

a)

<movie>

b)

<video>

c)

<media>

22.

What is the correct HTML element for playing audio files?

a)

<mp3>

b)

<audio>

c)

<sound>

23.

In HTML, onblur and onfocus are:

a)

Style attributes

b)

Event attributes

c)

HTML elements

24.

Graphics defined by SVG is in which format?

a)

HTML

b)

XML

c)

CSS

25.

The HTML <canvas> element is used to:

a)

draw graphics

b)

display database records

c)

manipulate data in MySQL

d)

create draggable elements

26.

In HTML, which attribute is used to specify that an input field must be filled out?

a)

required

b)

formvalidate

c)

placeholder

d)

validate

27.

Which input type defines a slider control?

a)

range

b)

slider

c)

search

d)

controls

28.

Which HTML element is used to display a scalar measurement within a range?

a)

<range>

b)

<meter>

c)

<measure>

d)

<gauge>

29.

Which HTML element defines navigation links?

a)

<nav>

b)

<navigate>

c)

<navigation>

30.

In HTML, what does the

a)

A navigation list to be shown at the left side of the page

b)

Content aside from the page content

c)

The ASCII character-set; to send information between computers on the Internet

31.

Which HTML element is used to specify a header for a document or section?

a)

<section>

b)

<head>

c)

<header>

d)

<top>

32.

What is the correct HTML for referring to an external style sheet?

a)

<style src="mystyle.css">

b)

<link rel="stylesheet" type="text/css" href="mystyle.css">

c)

<stylesheet>mystyle.css</stylesheet>

33.

Where in an HTML document is the correct place to refer to an external style sheet?

a)

At the end of the document

b)

In the <head> section

c)

In the <body> section

34.

Which HTML tag is used to define an internal style sheet?

a)

<style>

b)

<script>

c)

<css>

35.

Which HTML attribute is used to define inline styles?

a)

font

b)

styles

c)

class

d)

style

36.

How do you insert a comment in a CSS file?

a)

// this is a comment //

b)

// this is a comment

c)

' this is a comment

d)

/* this is a comment */

37.

Which property is used to change the background color?

a)

background-color

b)

color

c)

bgcolor

38.

Which CSS property is used to change the text color of an element?

a)

text-color

b)

fgcolor

c)

color

39.

Which CSS property controls the text size?

a)

font-style

b)

font-size

c)

text-size

d)

text-style

40.

How do you make each word in a text start with a capital letter?

a)

text-style:capitalize

b)

transform:capitalize

c)

You can't do that with CSS

d)

text-transform:capitalize

41.

Which property is used to change the font of an element?

a)

font-style

b)

font-weight

c)

font-family

42.

How do you make the text bold?

a)

font:bold;

b)

font-weight:bold;

c)

style:bold;

43.

How do you display a border like this: The top border = 10 pixels, The bottom border = 5 pixels, The left border = 20 pixels, The right border = 1pixel?

a)

border-width:10px 5px 20px 1px;

b)

border-width:10px 20px 5px 1px;

c)

border-width:5px 20px 10px 1px;

d)

border-width:10px 1px 5px 20px;

44.

Which property is used to change the left margin of an element?

a)

margin-left

b)

indent

c)

padding-left

45.

How do you make a list that lists its items with squares?

a)

list: square;

b)

list-style-type: square;

c)

list-type: square;

46.

How do you select an element with id "demo"?

a)

.demo

b)

#demo

c)

*demo

d)

demo

47.

How do you select elements with class name "test"?

a)

.test

b)

*test

c)

test

d)

#test

48.

How do you select all p elements inside a div element?

a)

div p

b)

div + p

c)

div.p

49.

How do you group selectors?

a)

Separate each selector with a space

b)

Separate each selector with a comma

c)

Separate each selector with a plus sign

50.

What is the default value of the position property?

a)

static

b)

relative

c)

fixed

d)

absolute