Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML & CSS Practice

Total questions: 20

Worksheet time: 15mins

Name
Class
Date
1.

Which property is used to change the background color in HTML code?

a)

color

b)

bgcolor

c)

background-color

2.

How do you add a color for <h1> element using Inline CSS?


a)

h1{color:blue;}

b)

<h1 style="color:blue">

3.

What is wrong with the code <body>Hello<body/>?

a)

it should be </body>Hello<body>

b)

it should be </body>Hello</body>

c)

it should be <body>Hello</body>

d)

it should be <body>Hello<body>

4.

What attribute of the img tag displays things on the page if the picture cannot be?

a)

src

b)

alt

c)

style

d)

height

5.

What is wrong with the code <br>?

a)

nothing

b)

it should be </br>

c)

it should be <br \>

d)

it should be <br />

6.

What HTML tag makes a link?

a)

<a>

b)

<tr>

c)

<img>

d)

<br>

7.

What HTML tag do you put things in if you want them to appear on the page?

a)

<html>

b)

<head>

c)

<body>

d)

<p>

8.

Which is the correct Internal CSS style to add 'yellow' background color to web page?

a)

p

{color:yellow;}

b)

body

{color:yellow;}

c)

body

{background-color:yellow;}

d)

body

{bgcolor=yellow}

9.

Which of the below is the abbreviation of CSS ?

a)

Cascade sheets style

b)

Color and style sheets

c)

Cascading style sheets

d)

Coded Style Sheet

10.

Which is the correct CSS syntax?

a)

{p:color=black(p}

b)

p {color: black;}

c)

{p;color:black}

d)

p:color=black

11.

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

a)

<script>

b)

<style>

c)

<CSS>

d)

<body>

12.

Where are inline styles typed?

a)

In the external style sheet

b)

Inside the <style> tag

c)

Inside the <head> tag

d)

In the body, inside the element tag

13.

Which is the value in this CSS?
p {color: red;}

a)

p

b)

red

c)

color

14.

In this code <img src

What does img stand for?

a)

iMac

b)

amazing

c)

image

d)

picture

15.

Write code to add pink color to your h2 tag using Internal CSS.

4 lines
16.

Write code to add blue color to your p tag using Inline CSS.

4 lines
17.

Which tag is used when creating a list with a specific order (by default, will show up as a numbered list)?

a)

<ul>

b)

<li>

c)

<ol>

d)

<p>

18.

What is the correct HTML for inserting an image?

a)

<image src="image.gif" alt="A Saskatchewan flag picture.">

b)

<img href="image.gif" alt="A Saskatchewan flag picture.">

c)

<img src="image.gif">

d)

<img alt="A Saskatchewan flag picture.">image.gif</img>

19.

Where in an HTML document is the correct place to include Internal CSS in your HTML?

a)

In the <body> section

b)

At the top of the document

c)

In the <head> section

d)

At the end of the document

20.

If you want to use a background color for your entire webpage, which tag should you select in your CSS?

a)

<body>

b)

<html>

c)

<h1>

d)

<p>