wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML and CSS Quiz

Total questions: 61

Worksheet time: 58mins

Name
Class
Date
1.

Which tag is used for the largest heading?

a)
b)
c)
d)
2.

Which tag inserts a line break?

a)
b)
c)
d)
3.

Which is correct HTML bold tag?

a)
b)
c)
d)

Both b and c

4.

HTML comment syntax is:

a)

// comment

b)

/* comment */

c)

# comment

d)
5.

To create a hyperlink:

a)
b)
c)
d)
6.

Which tag displays an image?

a)
b)
c)
d)
7.

Ordered list uses:

a)
b)
c)
d)
8.

To set background color:

a)

backgroundcolor

b)

bgcolor

c)

color

d)

background

9.

CSS is written inside ______ tag for internal CSS.

a)
b)
c)
d)
10.

Which is correct HTML table row tag?

a)
b)
c)
d)
11.

Form is created using:

a)
b)
c)
d)
12.

Checkbox input type is:

a)

type="check"

b)

type="tick"

c)

type="checkbox"

d)

type="radio"

13.

JavaScript is added using:

a)
b)
c)
d)
14.

CSS external file extension is:

a)

.css

b)

.style

c)

.sheet

d)

.txt

15.

To create divisions:

a)
b)
c)
d)
16.

Unordered list uses bullets by default.

a)

True

b)

False

17.

To merge table columns:

a)

colspan

b)

merge

c)

join

d)

span-column

18.

To set inline CSS:

a)

css=" "

b)

style=" "

c)

inline=" "

d)

text=" "

19.

To create password field:

a)

type="pass"

b)

type="password"

c)

type="pwd"

d)

type="hidden"

20.

Anchor target "_blank" means:

a)

Open in same tab

b)

Open in new tab

c)

Open in popup

d)

Disable link

21.

Choose correct CSS syntax:

a)

p {color: blue;}

b)

p = blue

c)

p:color = blue

d)

p(color=blue)

22.

Which attribute is used for image tooltip?

a)

hint

b)

alt

c)

title

d)

name

23.

HTML5 layout tag:

a)
b)
c)
d)
24.

Which attribute links external CSS?

a)

import

b)

href

c)

link

d)

src

25.

In CSS, #id selects:

a)

All elements

b)

Class

c)

ID

d)

Tag

26.

Which tag creates dropdown list?

a)
b)
c)
d)
27.

To insert JavaScript externally:

a)
b)
c)
d)
28.

To align image right using HTML:

a)

align="right"

b)

position="right"

c)

img-right

d)

float="right"

29.

Table header cell is:

a)
b)
c)
d)
30.

CSS property for background image:

a)

bg-image

b)

background-image

c)

background-pic

d)

img

31.

Padding means:

a)

Space inside border

b)

Space outside border

c)

Border thickness

d)

Font spacing

32.

Correct syntax for paragraph color:

a)

p {text-color: red;}

b)

p {color: red;}

c)

color="red"

d)

p.color(red)

33.

To create multi-line text box:

a)
b)
c)
d)
34.

Button code:

a)
b)
c)

Both

d)

None

35.

Which statement prints “Hello JS”?

a)

print("Hello JS");

b)

console.log("Hello JS");

c)

log("Hello JS");

d)

document.write.log("Hello JS")

36.

HTML5 audio tag:

a)
b)
c)
d)
37.

CSS class selector:

a)

.className

b)

#className

c)

%className

d)

@className

38.

HTML attribute to upload file:

a)

type="upload"

b)

type="file"

c)

type="browse"

d)

type="document"

39.

Default display of

is:

a)

inline

b)

block

c)

flex

d)

none

40.

Which creates horizontal line?

a)
b)
c)
d)
41.

Which CSS unit is relative to parent font size?

a)

px

b)

em

c)

cm

d)

mm

42.

Correct HTML5 video embed:

a)
b)
c)
d)
43.

To span rows in table:

a)

rowspan

b)

row-merge

c)

joinrow

d)

rowspaning

44.

Which CSS is highest priority?

a)

External

b)

Internal

c)

Inline

d)

Browser default

45.

Identify correct CSS float code:

a)

float right;

b)

float="right";

c)

float: right;

d)

right: float;

46.

HTML5 semantic tag NOT used for layout:

a)
b)
c)
d)
47.

JavaScript runs:

a)

On server only

b)

On browser only

c)

Mostly on client side

d)

Only in database

48.

Which tag is used for form grouping?

a)
b)
c)
d)
49.

CSS property for shadow behind box:

a)

shadow

b)

box-shadow

c)

bg-shadow

d)

effect-shadow

50.

Correct table with border code:

a)
b)
c)

1

d)
51.

Write HTML code to create a navigation bar using

4 lines
52.

Write HTML code to create a table with headings Name, Age, City.

4 lines
53.

Write CSS code to make a div of width 300px and blue background.

4 lines
54.

Write CSS code to create a box with border-radius 10px.

4 lines
55.

Write CSS code to apply background image to the entire page.

4 lines
56.

Write HTML code to display “Hello Internet” inside an

tag.

4 lines
57.

Write HTML code to create a simple paragraph with bold and italic text.

4 lines
58.

Write HTML code to create an ordered list of 3 fruits.

4 lines
59.

Write HTML code to create an unordered list of 3 programming languages.

4 lines
60.

Write HTML code to insert an image with width 200px.

4 lines
61.

Write HTML code to create a hyperlink to google.com.

4 lines