wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Last HTML and CSS Quiz

Total questions: 23

Worksheet time: 17mins

Name
Class
Date
1.

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

a)

<css>

b)

<style>

c)

<script>

d)

<link>

2.

What is the correct CSS property to make a text bold?

a)

font-weight: bold;

b)

text-style: bold;

c)

font-bold: true;

d)

bold: yes;

3.

Which of the following is the correct syntax to apply a class in CSS?

a)

#classname {}

b)

.classname {}

c)

classname {}

d)

@classname {}

4.

What is the default position property of an HTML element?

a)

relative

b)

absolute

c)

static

d)

fixed

5.

In CSS, how do you select all <p> elements inside a <div>?

a)

div p {}

b)

div > p {}

c)

div + p {}

d)

div, p {}

6.

Which CSS property is used to control the space between elements' borders and their content?

a)

margin

b)

padding

c)

spacing

d)

border-spacing

7.

What is the correct way to include an external CSS file in an HTML document?

a)

<link href="styles.css">

b)

<style src="styles.css">

c)

<css link="styles.css">

d)

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

8.

In HTML, the < (a)   > tag is used to create a hyperlink.

9.

The CSS property used to change the background color of an element is (a)   .

10.

In CSS, display: (a)   ; is used to make an element take up the full width available and start on a new line.

11.

The HTML5 tag < (a)   > is used to define self-contained content, such as blog posts or news articles.

12.

To apply a CSS file to an HTML document, we use the <link> tag inside the < (a)   > section.

13.

Which HTML attribute specifies an alternative text for an image?

a)

alt

b)

title

c)

src

d)

href

14.

Which CSS property is used to make text italic?

a)

font-italic

b)

text-style

c)

font-style

d)

text-italic

15.

In HTML, which tag is used to define a table row?

a)

table

b)

td

c)

th

d)

tr

16.

In HTML, the < (a)   > tag is used to define a form input field.

17.

In CSS, (a)   is the property used to set the space between letters in a text.

18.

Which CSS property controls the transparency of an element?

(a)  

19.

The < (a)   > tag is used to create an unordered list in HTML.

20.

In CSS, the (a)   property is used to specify a custom font for a webpage.

21.

What is the correct syntax for applying a box shadow to an element?

a)

box-shadow: 5px 5px 10px gray;

b)

shadow-box: gray 5px 5px 10px;

c)

box-shadow: gray (5px, 5px, 10px);

d)

shadow: 5px 5px 10px gray;

22.

How many values can the text-shadow property take at a minimum?

a)

1

b)

2

c)

3

d)

4

23.

In CSS, the (a)   property is used to apply a shadow effect to text elements.