wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML & CSS QUIZ 2

Total questions: 30

Worksheet time: 20mins

Name
Class
Date
1.

What symbol should you use to target an id in css?

a)

.

b)

+

c)

id

d)

#

2.

What symbol should you use to target a class name in css?

a)

#

b)

()

c)

.

d)

class

3.

What is the correct syntax to change the background color with css?

a)

background-color: purple;

b)

background-color = "purple";

c)

backgroundcolor=orange

d)

change-background-color: purple

4.

What is missing from this HTML skeleton?


<!DOCTYPE html>

<html>

<body>

</body>

</html>

a)

<head></head>

b)

<div></div>

c)

<img></img>

d)

<head>

5.

How do you change the font color with CSS?

a)

font-color: green;

b)

color: green;

c)

change-font-color: green;

d)

fontcolor=green;

6.

Where should you put the link tag to connect your CSS and HTML file?

a)

Between the <head> </head> in HTML

b)

Between the <body> </body> in HTML

c)

None of the above.

7.

Which of the following is the correct CSS link tag?

a)

<link rel="styles" href="stylesheet.css">

b)

<link href="stylesheet">

c)

<link rel="stylesheet" src="styles.css">

d)

<link rel="stylesheet" href="styles.css">

8.
which property is used to add space around the content and border?
a)
margin
b)
span
c)
padding
d)
position
9.
How to change the below code to inline CSS code <p><font color = "green" size = "5">Hello, World!</font></p>
a)
<p style = "font-color:green; font-size:24px;" >Hello, World!</p>
b)
<p style = "color:green; font-size:24px;" >Hello, World!</p>
c)
<p style = "font color:green, size:24px;" >Hello, World!</p>
d)
<p style = "color:green; size:24px;" >Hello, World!</p>
10.

Which of the below options is correct to change the background color to blue in CSS?

a)

body {

background-colour: lightblue;

}

b)

body {

background-color: lightblue;

}

c)

body {

background:color: lightblue;

}

d)

None of the above

11.
Which of the following properties is used to specify the kind of border to display?
a)
border
b)
border:style
c)
border-style
d)
None of the above
12.

Every element of html coding must have an opening and closing tag.

a)

True

b)

False

13.

What is the proper way to code a website title using HTML

a)

title{

New Website}

b)

<title>New Website</title>

c)

.tile New Website

d)

<title>New Website<title>

14.

What HTML code is used to center the words on the page when the coding starts on the left margin?

a)

right-align;

b)

<center></center>

c)

left-align;

d)

<middle></middle>

15.

What is the correct code for a paragraph in CSS?

a)

P

b)

<p> </p>

c)

.p

d)

p{

}

16.
Which item refers to the start tag, the end tag and everything in between?
a)
HTML Element
b)
HTML Tag
c)
HTML Attribute
d)
CSS
17.
What is the proper code to insert an image named "frog.jpg"?
a)
<img src="frog" width="104" height="142">
b)
<img="frog.jpg" width="104" height="142">
c)
<img src="frog.jpg" width="104" height="142">
d)
<img ="frog" width="104" height"142">
18.
Annie wants the name of her product to be the main heading at the top of her webpage. Which tag defines
the main heading in a web document?
a)
<h3>Product</h3>
b)
<h5>Product</h5>
c)
<h1>Product</h1>
d)
<h6>Product</h6>
19.
Which tag defines the visible content of a web document?
a)
<head>
b)
<meta>
c)
<title>
d)
<body>
20.
When using a text editor, what file extension(s) must be used when saving as a web document?
a)
txt
b)
html or htm
c)
doc
d)
css
21.
Which line of code correctly places a gif image named "tiger" into a webpage?
a)
<img src="tiger" alt="BengalTiger" />
b)
<img gif=tiger alt="BengalTiger">
c)
<image source="tiger.gif" alt=BengalTiger" />
d)
<img src="tiger.gif" alt="BengalTiger" />
22.
Which line of code correctly creates a link to Amazon's website?
a)
<a ref=http://www.amazon.com>Amazon
b)
<href=http://www.amazon.com>Amazon<a>
c)
<a href="http://www.amazon.com">Amazon
d)
<a href="http://www.amazon.com">Amazon</a>
23.

Tag such as <head>, <h1>, <p> are (a)   tags. (hint: types of tag)

24.

In a table, which tag is used for inserting table headings?

a)

<table>

b)

<td>

c)

<th>

d)

<caption>

25.

Write the basic structure of an HTML document

4 lines
26.

Google Chrome, Mozilla Firefox, Microsoft Edge are examples of?

a)

Websites

b)

Search engines

c)

Text editors

d)

Web browsers

27.
What unit of measurement does CSS use for size?
a)
px
b)
em
c)
%
d)
All work
28.
What is the difference between an HTML Tag and an HTML element?
a)
An HTML Tag is case sensitive and an HTML element is not case sensitive.
b)
An HTML Tag is always paired and an HTML element is an "empty" tag.
c)
An HTML Tag defines content and an HTML Element includes the opening and closing tags and everything in between.
d)
An HTML Tag defines content and an HTML Element gives additional meaning and content.
29.

Which of the following is the proper way to apply the CSS code inside style.css to the home.html file?

a)

Inside home.html:


<head>

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

</head>

b)

Inside home.html:


<head>

<style href="style.css"></style>

</head>

c)

Inside style.css:


<html href="home.html">

d)

Inside style.css:


applyTo {

href: home.html;

}

30.

Which of the following selects all p tags with the class alert and makes them red?

a)

p.alert {

color: red;

}

b)

p {

.alert {

color:red;

}

}

c)

.alert p{

color: red;

}

d)

p alert{

color: red;

}