Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

html css

Total questions: 60

Worksheet time: 3600secs

Name
Class
Date
1.
What does HTML stand for?
a)
Hyper Text Markup Language
b)
High Text Machine Language
c)
Hyperlink Text Mark Language
d)
Hyper Transfer Markup Language
2.
What does CSS stand for?
a)
Colorful Style Sheets
b)
Cascading Style Sheets
c)
Creative Style Syntax
d)
Computer Style Sheets
3.
Which tag is used to create a hyperlink?
a)
<link>
b)
<a>
c)
<href>
d)
<url>
4.
How do you include an external CSS file?
a)
<css src="style.css">
b)
<link rel="stylesheet" href="style.css">
c)
<style src="style.css">
d)
<script src="style.css">
5.
The difference between id and class in CSS is:
a)
id can be used multiple times, class only once
b)
id is unique, class can be used multiple times
c)
id is for styling, class is for scripts
d)
id is faster than class
6.
Which HTML element is used for images?
a)
<img>
b)
<picture>
c)
<image>
d)
<src>
7.
The default display of a <div> element is:
a)
inline
b)
block
c)
inline-block
d)
none
8.
How do you make text bold semantically in HTML?
a)
<b>
b)
<strong>
c)
<bold>
d)
<em>
9.
What is the purpose of the meta viewport tag?
a)
To link CSS files
b)
To define character encoding
c)
To make the page responsive on mobile devices
d)
To insert images
10.
Which property is used to change the font of an element in CSS?
a)
font-style
b)
font-weight
c)
font-family
d)
text-style
11.
Which CSS property controls the space inside an element?
a)
margin
b)
padding
c)
border
d)
spacing
12.
Which CSS property controls the space outside an element?
a)
padding
b)
margin
c)
border
d)
spacing
13.
What is the difference between inline and block elements?
a)
Inline elements start on a new line
b)
Block elements do not start on a new line
c)
Block elements start on a new line, inline elements do not
d)
Inline elements can contain block elements
14.
Which CSS property is used to position elements relative to their normal position?
a)
absolute
b)
relative
c)
fixed
d)
static
15.
Which pseudo-class is used to change an element on hover?
a)
:click
b)
:hover
c)
:active
d)
:focus
16.
Which HTML5 element is used for self-contained content?
a)
<div>
b)
<section>
c)
<article>
d)
<span>
17.
How do you make a list without bullets in CSS?
a)
list-style: none;
b)
list: none;
c)
list-type: none;
d)
list-decoration: none;
18.
Which CSS unit is relative to the root font size?
a)
px
b)
em
c)
rem
d)
%
19.
Which HTML attribute makes an input field required?
a)
validate
b)
required
c)
placeholder
d)
mandatory
20.
What is the correct CSS syntax to select elements with class 'test'?
a)
#test {}
b)
.test {}
c)
*test {}
d)
test {}
21.
Which HTML element is used to define navigation links?
a)
<nav>
b)
<navigation>
c)
<menu>
d)
<ul>
22.
Which CSS property changes the transparency of an element?
a)
opacity
b)
visibility
c)
alpha
d)
transparency
23.
What is the difference between display: none and visibility: hidden?
a)
None
b)
display: none hides and removes element from layout, visibility: hidden hides but keeps space
c)
display: none hides but keeps space, visibility: hidden removes element
d)
visibility: hidden removes element from DOM
24.
Which property is used to control layering of elements?
a)
position
b)
z-index
c)
stack-order
d)
layer
25.
Which HTML element is used for the largest heading?
a)
<h1>
b)
<h6>
c)
<heading>
d)
<head>
26.
Which CSS property is used to change the background color?
a)
bg-color
b)
background-color
c)
color-background
d)
background
27.
How do you add a comment in HTML?
a)
// This is comment
b)
<!-- This is comment -->
c)
/* This is comment */
d)
# This is comment
28.
How do you add a comment in CSS?
a)
// This is comment
b)
<!-- This is comment -->
c)
/* This is comment */
d)
# This is comment
29.
Which HTML element is used to display a numbered list?
a)
<ol>
b)
<ul>
c)
<li>
d)
<dl>
30.
Which CSS property is used to control font size?
a)
text-size
b)
font-size
c)
font-style
d)
text-style
31.
Which attribute specifies the URL of a link?
a)
src
b)
href
c)
link
d)
url
32.
Which HTML element is used to group related content in a document?
a)
<span>
b)
<div>
c)
<section>
d)
<article>
33.
Which property is used to control how an element wraps inside a flex container?
a)
flex-wrap
b)
flex-flow
c)
flex-direction
d)
wrap
34.
Which unit in CSS is relative to the parent element’s font size?
a)
px
b)
rem
c)
em
d)
%
35.
Which attribute is used to define the alternative text for an image?
a)
src
b)
alt
c)
title
d)
caption
36.
Which HTML element is used to create a checkbox?
a)
<input type="checkbox">
b)
<check>
c)
<input type="check">
d)
<checkbox>
37.
Which CSS property is used to make text italic?
a)
font-style: italic;
b)
text-style: italic;
c)
font-weight: italic;
d)
text-decoration: italic;
38.
Which HTML attribute specifies an inline style?
a)
style
b)
class
c)
id
d)
css
39.
How do you select an element with id 'header' in CSS?
a)
.header {}
b)
#header {}
c)
header {}
d)
*header {}
40.
Which HTML element is used to embed a video?
a)
<video>
b)
<media>
c)
<movie>
d)
<iframe>
41.
What is the correct way to write a media query for screens smaller than 600px?
a)
@media screen and (max-width: 600px) {}
b)
@media (min-width: 600px) {}
c)
@media screen < 600px {}
d)
@media only screen 600px {}
42.
Which property is used to change the text color?
a)
font-color
b)
text-color
c)
color
d)
text-style
43.
Which CSS property is used to add space between letters?
a)
letter-spacing
b)
word-spacing
c)
text-spacing
d)
font-spacing
44.
Which element is used to define the footer of a page?
a)
<bottom>
b)
<footer>
c)
<foot>
d)
<section>
45.
How do you make a list horizontal in CSS?
a)
list-style: horizontal;
b)
display: flex;
c)
float: horizontal;
d)
inline-list: true;
46.
Which CSS property is used to apply a shadow to text?
a)
text-shadow
b)
font-shadow
c)
shadow
d)
box-shadow
47.
Which HTML element is used for emphasized text?
a)
<em>
b)
<i>
c)
<strong>
d)
<b>
48.
Which CSS property is used for rounded corners?
a)
corner-radius
b)
border-radius
c)
round-corner
d)
radius
49.
How do you make an element stick to the top of the page while scrolling?
a)
position: absolute;
b)
position: sticky; top: 0;
c)
position: fixed; bottom: 0;
d)
position: relative;
50.
Which HTML element is used to define an input for a password?
a)
<input type="password">
b)
<password>
c)
<input type="text">
d)
<pass>
51.
Which CSS property is used to change the order of flex items?
a)
flex-order
b)
order
c)
item-order
d)
flex-position
52.
Which HTML tag is used for inserting a line break?
a)
<break>
b)
<lb>
c)
<br>
d)
<line>
53.
Which CSS property is used to control the space between lines of text?
a)
line-height
b)
letter-spacing
c)
text-spacing
d)
spacing-line
54.
Which HTML element is used to create a drop-down list?
a)
<select>
b)
<dropdown>
c)
<list>
d)
<option>
55.
Which CSS property is used to apply a linear gradient background?
a)
background-image
b)
background-gradient
c)
gradient
d)
bg-linear
56.
Which HTML5 element is used to play audio?
a)
<sound>
b)
<audio>
c)
<music>
d)
<media>
57.
Which CSS property is used to create rounded borders for only specific corners?
a)
border-radius
b)
border-corner
c)
border-clip
d)
corner-radius
58.
Which HTML attribute is used to specify the target of a link?
a)
href
b)
src
c)
target
d)
link
59.
Which CSS property is used to hide content but keep its space reserved?
a)
display: none;
b)
visibility: hidden;
c)
opacity: 0;
d)
position: off;
60.
Which CSS function is used to combine multiple transformations?
a)
transform()
b)
matrix()
c)
translate()
d)
rotate()