wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML and CSS Basics (100 Q)

Total questions: 102

Worksheet time: 51mins

Name
Class
Date
1.

What does HTML stand for?

a)

Hyper Trainer Marking Language

b)

Hyper Text Markup Language

c)

Hyper Tool Markup Language

d)

Hyperlink Text Markup Language

2.

Which tag is used to define the largest heading?

a)

h6

b)

head

c)

h1

d)

heading

3.

Which tag is used to create a paragraph in HTML?

a)

par

b)

p

c)

text

d)

pg

4.

Which attribute specifies a link’s destination?

a)

src

b)

href

c)

link

d)

target

5.

Which tag inserts a line break?

a)

br

b)

lb

c)

line

d)

break

6.

Which tag is used for inserting an image?

a)

image

b)

src

c)

img

d)

pic

7.

Which attribute specifies alternative text for an image?

a)

href

b)

title

c)

alt

d)

caption

8.

Which tag creates a hyperlink?

a)

a

b)

link

c)

h

d)

url

9.

Which tag creates an unordered list?

a)

ol

b)

ul

c)

list

d)

li

10.

Which tag is used inside ul or ol?

a)

ol

b)

ul

c)

li

d)

item

11.

Which tag is used to display tabular data?

a)

td

b)

tr

c)

table

d)

tab

12.

Which tag is used to create a form?

a)

input

b)

form

c)

action

d)

data

13.

Which tag is used to enter single-line text?

a)

text

b)

input type="text"

c)

textbox

d)

field

14.

Which element defines emphasized text?

a)

em

b)

strong

c)

italic

d)

i

15.

Which tag defines bold text?

a)

strong

b)

b

c)

em

d)

bold

16.

Which tag is used for inline grouping?

a)

div

b)

span

c)

section

d)

group

17.

Which element contains metadata about the document?

a)

header

b)

meta

c)

head

d)

info

18.

Which attribute is required for the img tag?

a)

alt

b)

src

c)

href

d)

id

19.

Which tag defines the document’s title in the browser tab?

a)

header

b)

title

c)

meta

d)

h1

20.

Which tag is used to define a block of navigation links?

a)

nav

b)

menu

c)

ul

d)

header

21.

Which element represents independent content like a blog post?

a)

section

b)

article

c)

div

d)

aside

22.

Which element usually contains site-wide footer information?

a)

bottom

b)

footer

c)

base

d)

aside

23.

Which element groups related content together in sections?

a)

section

b)

div

c)

nav

d)

head

24.

Which element defines introductory content or navigation for a page?

a)

title

b)

header

c)

head

d)

meta

25.

Which element is used for content that’s related but not main content?

a)

extra

b)

aside

c)

sidebar

d)

nav

26.

Which HTML5 element is used for scalable graphics?

a)

canvas

b)

img

c)

svg

d)

graphic

27.

Which element is used for playing video files?

a)

movie

b)

media

c)

video

d)

play

28.

Which element is used for audio content?

a)

mp3

b)

media

c)

audio

d)

sound

29.

Which attribute specifies a video file source?

a)

src

b)

href

c)

file

d)

location

30.

Which element represents tabular row data?

a)

td

b)

row

c)

tr

d)

table

31.

Which element defines a table cell?

a)

tr

b)

td

c)

cell

d)

column

32.

Which element defines a table heading?

a)

td

b)

head

c)

th

d)

h1

33.

Which tag is used for grouping form elements?

a)

fieldset

b)

group

c)

legend

d)

form

34.

Which tag provides a caption for a table?

a)

header

b)

caption

c)

title

d)

summary

35.

Which attribute is used to merge table columns?

a)

rowspan

b)

colspan

c)

merge

d)

align

36.

Which element provides a text label for a form control?

a)

label

b)

name

c)

span

d)

p

37.

Which form input type hides typed characters?

a)

text

b)

password

c)

hidden

d)

secure

38.

Which form input allows multiple selections?

a)

checkbox

b)

radio

c)

text

d)

button

39.

Which input type allows only one option from a set?

a)

checkbox

b)

radio

c)

text

d)

select

40.

Which element is used to embed another HTML page?

a)

frame

b)

iframe

c)

window

d)

embed

41.

What does CSS stand for?

a)

Creative Style Sheets

b)

Cascading Style Sheets

c)

Computer Style Sheets

d)

Colorful Style Syntax

42.

Which property changes text color?

a)

font-color

b)

text-color

c)

color

d)

style

43.

Which property changes background color?

a)

bgcolor

b)

background-color

c)

color

d)

style

44.

Which CSS selector selects an element by ID?

a)

.id

b)

#id

c)

id=

d)

*id

45.

Which CSS selector selects elements by class?

a)

#classname

b)

.classname

c)

classname

d)

*classname

46.

Which property changes font size?

a)

text-size

b)

font-size

c)

size

d)

font

47.

Which property makes text bold?

a)

font-weight

b)

text-style

c)

font-bold

d)

bold

48.

Which property makes text italic?

a)

font-style: italic

b)

font-italic

c)

text-style

d)

italic

49.

Which property underlines text?

a)

text-decoration: underline

b)

underline

c)

font-decoration

d)

text-style

50.

Which CSS property aligns text horizontally?

a)

text-align

b)

align

c)

font-align

d)

center

51.

Which property controls spacing between lines of text?

a)

line-height

b)

letter-spacing

c)

spacing

d)

word-height

52.

Which property controls spacing between letters?

a)

letter-spacing

b)

line-height

c)

word-spacing

d)

margin

53.

Which property controls spacing between words?

a)

word-spacing

b)

text-spacing

c)

letter-spacing

d)

padding

54.

Which property adds shadow to text?

a)

text-shadow

b)

font-shadow

c)

shadow-text

d)

box-shadow

55.

Which property changes font family?

a)

font-style

b)

font-family

c)

text-font

d)

font-type

56.

Which CSS method applies styles directly in the HTML tag?

a)

external

b)

inline

57.

Which property changes font family?

a)

font-style

b)

font-family

c)

text-font

d)

font-type

58.

Which CSS method applies styles directly in the HTML tag?

a)

external

b)

inline

c)

internal

d)

embedded

59.

Which CSS method uses a style tag in the HTML head?

a)

inline

b)

internal

c)

external

d)

embedded

60.

Which CSS method links an external stylesheet?

a)

link

b)

style

c)

css

d)

external

61.

Which property sets the background image?

a)

background-image

b)

image

c)

bg-image

d)

img

62.

Which property sets the background to repeat or not?

a)

repeat

b)

background-repeat

c)

bg-repeat

d)

background

63.

Which property sets the width of an element?

a)

size

b)

width

c)

length

d)

dimension

64.

Which property sets the height of an element?

a)

height

b)

size

c)

length

d)

dimension

65.

Which property adds space inside an element’s border?

a)

margin

b)

padding

c)

spacing

d)

indent

66.

Which property adds space outside an element’s border?

a)

padding

b)

margin

c)

border-spacing

d)

indent

67.

Which property sets the border color?

a)

border-color

b)

border-style

c)

border-width

d)

color

68.

Which property sets the border style to solid, dotted, or dashed?

a)

border-type

b)

border-style

c)

border-look

d)

border-decoration

69.

Which property sets the border thickness?

a)

border-size

b)

border-width

c)

border-style

d)

thickness

70.

Which property makes corners rounded?

a)

border-radius

b)

border-curve

c)

round-corner

d)

border-shape

71.

Which property controls how content overflows a box?

a)

overflow

b)

clip

c)

hide

d)

scroll

72.

Which CSS property hides an element but keeps space reserved?

a)

display: none

b)

visibility: hidden

c)

hidden: true

d)

opacity: 0

73.

Which CSS property hides an element completely with no space reserved?

a)

opacity: 0

b)

display: none

c)

visibility: hidden

d)

hidden: true

74.

Which CSS property controls transparency?

a)

alpha

b)

opacity

c)

transparency

d)

visibility

75.

Which property controls how background images fit inside an element?

a)

background-fit

b)

background-size

c)

background-scale

d)

background-repeat

76.

Which property positions an element relative to its parent?

a)

float

b)

position

c)

align

d)

display

77.

Which position value places an element at the normal flow?

a)

fixed

b)

relative

c)

static

d)

absolute

78.

Which position value fixes an element to the viewport?

a)

relative

b)

static

c)

absolute

d)

fixed

79.

Which property makes an element float to the left or right?

a)

position

b)

float

c)

align

d)

display

80.

Which property clears floated elements?

a)

remove

b)

clear

c)

float: none

d)

reset

81.

Which CSS property turns an element into a flex container?

a)

display: flex

b)

flex: true

c)

flexbox

d)

container

82.

Which property aligns flex items horizontally?

a)

align-items

b)

justify-content

c)

flex-direction

d)

text-align

83.

Which property aligns flex items vertically?

a)

align-items

b)

justify-content

c)

vertical-align

d)

flex-direction

84.

Which property controls the direction of flex items?

a)

flex-align

b)

flex-direction

c)

direction

d)

align

85.

Which property allows grid layout?

a)

display: grid

b)

grid: true

c)

gridbox

d)

container

86.

Which property defines the number of grid columns?

a)

grid-columns

b)

grid-template-columns

c)

column-count

d)

grid-layout

87.

Which property defines the number of grid rows?

a)

grid-rows

b)

grid-template-rows

c)

row-count

d)

grid-layout

88.

Which CSS selector selects all elements?

a)

*

b)

all

c)

#all

d)

.all

89.

Which selector selects all paragraph elements?

a)

#p

b)

p

c)

.p

d)

text

90.

Which selector selects only elements with class “highlight”?

a)

#highlight

b)

.highlight

c)

highlight

d)

*highlight

91.

Which selector selects only the element with ID “header”?

a)

.header

b)

header

c)

#header

d)

*header

92.

Which pseudo-class styles a link when hovered over?

a)

:hover

b)

:link

c)

:visited

d)

:active

93.

Which pseudo-class styles a link after it is clicked?

a)

:hover

b)

:visited

c)

:link

d)

:focus

94.

Which pseudo-class styles an element while it is clicked?

a)

:focus

b)

:active

c)

:hover

d)

:visited

95.

Which pseudo-class styles an input when selected?

a)

:hover

b)

:focus

c)

:selected

d)

:click

96.

Which property sets the maximum width of an element?

a)

width

b)

max-width

c)

min-width

d)

size

97.

Which property sets the minimum height of an element?

a)

min-height

b)

max-height

c)

height

d)

size

98.

Which CSS unit is relative to the parent element’s font size?

a)

px

b)

em

c)

%

d)

vh

99.

Which CSS unit is relative to the root element’s font size?

a)

em

b)

rem

c)

px

d)

%

100.

Which CSS unit is relative to the width of the viewport?

a)

vh

b)

vw

c)

%

d)

em

101.

Which CSS unit is relative to the height of the viewport?

a)

vh

b)

vw

c)

%

d)

rem

102.

Which property adds a shadow effect to a box?

a)

text-shadow

b)

box-shadow

c)

border-shadow

d)

shadow-box