wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML_CSS_Basics

Total questions: 15

Worksheet time: 5mins

Name
Class
Date
1.

Which tags don't need to be closed?

a)

h1,p

b)

head,body

c)

br, img

d)

html, a

2.

Which of the following are valid HTML tags used to create lists? (Select all that apply)

a)

<ul>

b)

<ol>

c)

<li>

d)

<list>

e)

<tr>

3.

What is the main purpose of HTML attributes?

a)

To add styling to HTML elements

b)

To define the structure of the webpage

c)

To insert JavaScript functions directly into the tag

d)

To add special commands or additional information that extend a tag’s behavior

4.

What is the purpose of the following HTML tag?
<meta charset="utf-8">

a)

It sets the default font for the webpage to UTF-8.

b)

It defines the page's language as UTF-8.

c)

It tells the browser to use UTF-8 character encoding, which supports most characters from all languages.

d)

It links an external stylesheet for UTF-8 compatibility.

5.

Which of the following statements about ordered (<ol>) and unordered (<ul>) lists are true?
(Select all that apply)

a)

<ol> displays list items with numbers by default

b)

You cannot style list bullets or numbers using CSS

c)

Both <ol> and <ul> must contain <li> elements inside

d)

<ul> displays list items with bullet points by default

6.

By default, images are displayed at their (a)   size.

7.

Which tags is necessary create table rows?

a)

table

b)

tr

c)

td

d)

th

8.

What is the purpose of the following HTML tag?
<link rel="stylesheet" href="fileName.css">

a)

It links an external CSS file to the HTML document

b)

It embeds CSS styles directly inside the HTML file

c)

It connects a JavaScript file to the HTML document

d)

It creates a hyperlink to another webpage

9.

Which of the following are correct ways to set text color in CSS?

a)

Using an RGB value like color: rgb(255, 236, 114);

b)

Using a hexadecimal value like color: #ff0000;

c)

Using a percentage value like color: 100%;

d)

Using parentheses after a color name like color(red);

10.

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

a)

<br>

b)

<break>

c)

<ul>

d)

<lb>

11.

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)

<color background="blue">

12.

Which HTML attribute is used to define inline styles?

a)

stules

b)

class

c)

style

d)

fond

13.

Which is the correct CSS syntax?

a)

{body;color:black;}

b)

{body=color:black;}

c)

body;color:black;

d)

body{color:black;}

14.

How do you insert a comment in a CSS file?

a)
Use // comment here to insert a comment in a CSS file.
b)
Insert a comment using # comment here in a CSS file.
c)
Use /* comment here */ to insert a comment in a CSS file.
d)
Use to insert a comment in a CSS file.
15.

Which of the below is the correct syntax to put a line over text in CSS?

a)

text-decoration: line

b)

text-decoration: overline

c)

text-decoration: underline

d)

text-decoration: none