Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

HTML CSS Quiz FOR CLASS 10TH

Total questions: 52

Worksheet time: 30mins

Name
Class
Date
1.

The property in CSS used to change the background color of an element is -

a)

bgcolor

b)

color

c)

background-color

d)

All of the above

2.

The property in CSS used to change the text color of an element is -

a)

background-color

b)

color

c)

bgcolor

d)

All of the above

3.

The CSS property used to control the element's font-size is -

a)

text-style

b)

text-size

c)

None of the above

d)

font-size

4.

The HTML attribute used to define the inline styles is -

a)

None of the above

b)

class

c)

styles

d)

style

5.

The HTML attribute used to define the internal stylesheet is -

a)

script

b)

html

c)

style

d)

css

6.

Which of the following CSS property is used to set the background image of an element?

a)

background-color

b)

None of the above

c)

background-image

d)

background-attachment

7.

Which of the following is the correct syntax to make the background-color of all paragraph elements to yellow?

a)

p {background-color : #yellow;}

b)

p {background-color : yellow;}

c)

all {background-color : yellow;}

d)

all p {background-color : #yellow;}

8.

Which of the following is the correct syntax to display the hyperlinks without any underline?

a)

a {text-decoration : none;}

b)

a {text-decoration : underline;}

c)

None of the above

d)

a {decoration : no-underline;}

9.

Which coding language helps create the layout/structure of the website?

a)

html

b)

css

c)

javascript

d)

java

10.
What symbols go around the properties for each CSS selector?
a)
< >
b)
[ ]
c)
{ }
d)
( )
11.
Which is the value in this CSS?
p {color: red;}
a)
p
b)
color
c)
red
12.
What is the function of a title tag?
a)
stores webpage title for browser and search engine results
b)
show server how to index the website
c)
shows meta information about the title
d)
shows server how to title the website
13.
What is the purpose of <!DOCTYPE html>?
a)
provides the web browser with security information
b)
instructs the browser where to look for your CSS files
c)
Allows programmers to link to files in-line
d)
Tells the web browser what language to expect
14.
If you want to have more than one declaration in a CSS rule, what character separates them?
a)
comma ,
b)
semi-colon ;
c)
colon :
15.
Which item interprets the source code in a web document?
a)
Text editor
b)
Web browser
c)
  HTML editor
d)
Web server
16.
Jerry wants to insert a line break into his webpage. Which code should he use?
a)
<ul>
b)
<li>
c)
<br>
d)
<h1>
17.
WYSIWYG stands for 
a)
What you see is what you get
b)
What you see is what you grab
c)
When you see is what you google
d)
Where you see is when you go
18.

Which of the following represents a domain name?

a)

Google

b)

.gov

c)

www.

d)

https://

19.

Fill in the blanks to create an order list starting at 10.

<_ _="10">

<li>HTML</li>

<li>CSS</li>

</ol>

(a)  

20.

Which one is correct HTML page structure ?

a)

<!DOCTYPE html>

<html>

<head>

<title></title>

</head>

<body>

</body>

</html>

b)

<!DOCTYPE html>

<html>

<body>

<head>

<title></title>

</head>

</body>

</html>

c)

<!DOCTYPE html>

<html>

<head>

<body>

</body>

<title></title>

</head>

</html>

d)

<head>

<title></title>

</head>

<body>

</body>

21.

Which one is Preserve Formatting Tag ?

a)

<pft>

b)

<pre>

c)

<br>

d)

<hr>

22.

Which is the correct form for html style attributes?

a)

value="property:style"

b)

style="value:property"

c)

style="property:value"

d)

None of the above

23.

Which of the following is the proper way to apply the CSS code inside style.css to the about.html file?

a)

Inside style.css:

applyTo {

href: about.html;

}

b)

Inside about.html:

<head>

<style href="style.css"></style>

</head>

c)

Inside style.css:

<html href="about.html">

d)

Inside about.html:

<head>

<link rel="stylesheet" type="text/css" href="style.css">

</head>

24.

You are trying to apply the same style to several different elements in a block, with line breaks before and after. Which tag should you use?

a)

<span>

b)

<div>

c)

<style>

d)

<src>

25.
John wants the name of his book to appear in search results for Google. Where should this information be
placed within his webpage?
a)
head
b)
meta
c)
body
d)
nav
26.

Comments in coding is used to help

a)

the programmer

b)

anyone viewing the website

c)

the editor of the code

d)

the reader of the code

27.
What are the three display properties?
a)
absolute, display, none
b)
block, inline, none
c)
relative, block, inline
d)
absolute, block, inline
28.
It is the basic text editing application in Windows.
a)
Sublime
b)
UltraEdit
c)
Expression Web
d)
Notepad
29.

How do you make the text bold in CSS code?

a)

font:bold;

b)

style:bold;

c)

font-weight:bold;

d)

href=bold

30.

___________ are used to separate each selector in grouping.

a)

#

b)

.

c)

;

d)

,

31.

Suppose there are 15 items in the list and you want to style the 9th item listed. What is the syntax used for it?

a)

li:9th-child

b)

li:nth-child(9)

c)

li:last-child(9)

d)

li:first-child(9)

32.

Which CSS selector applies to the yellow element(s) only? Select the correct answers!

a)

h1-.content{ ... }

b)

h1#content{ ... }

c)

.content h1{ ... }

d)

#content h1{ ...}

e)

none of the above

33.
What is this an example of?
/* This is a multi-line comment */
a)
Syntax
b)
Property 
c)
Value
d)
Comment
34.
Where in the HTML document is the correct location to insert code to link to your external CSS? 
a)
In the <head> section
b)
In the <body> section
c)
At the very end of the document
d)
At the very beginning of the document
35.

Which of the following symbols indicates an ending tag in HTML?

a)

;

b)

/

c)

<>

d)

!

36.

Which of the following lists includes EVERY type of code needed to make an unordered list?

a)

<ab> ... <li> .... </li> ... </ab>

b)

<unL> ... <li> .... </li> ... </unL>

c)

<ol> ... <li> .... </li> ... </ol>

d)

<ul> ... <li> .... </li> ... </ul>

37.

When should you use the <ol> code to make a list?

a)

Steps for a recipe

b)

Top 10 items

c)

List of names

d)

None of the above

38.
Which of these are in the correct order? (smallest to largest)
a)
B, KB, MB, TB, GB
b)
GB, KB, MB, TB, B
c)
B, KB, MB, GB, TB
d)
KB, MB, TB, GB, B
39.

A collection of interlinked web pages on the World Wide Web is called?

a)

Website

b)

Research

c)

Website Content

d)

Web Address

40.

You have a CSS element set up to display the figcaption element with a background color of antiquewhite. However the background color is running across the entire page even though the caption is not. Select the correct CSS code to have ONLY the background color on the text and NOT the width of the page:

figcaption {color: darkgreen;

background-color: antiquewhite;

________}

a)

display: inline;

b)

display: block;

c)

display: left;

d)

width: 200px

41.

Which table tag indicates a table cell?

a)

Tr

b)

Table

c)

Td

d)

Th

42.

You are constructing an external style sheet. You want hyperlinks to turn pink when a user moves the mouse over the link. Choose the proper selector to accomplish the task:

a:{color: slateblue;}

_________ {color: pink;}

a)

a.hover

b)

a:hover

c)

a#hover

d)

a[hover]

43.

You are trying to set a default font color of maroon. Select the correct property and value combination to make this happen.

body {

________

}

a)

font-color: maroon;

b)

text-color: maroon;

c)

background-color: maroon;

d)

color: maroon;

44.
Which code can be handy if we want to play background music that never stops? 
a)
<audio src="audio/background.mp3" autoplay loop></audio>
b)
<p>Listen to my favorite song:</p> <audio src="audio/song.mp3" controls autoplay></audio>
45.
Which CSS3 property rounds the corners on the elements that is used for the buttons?
a)
border-box-shadow
b)
border-style
c)
border-radius
d)
border-image
46.
When using a text editor, what file extension(s) must be used when saving as a web document?
a)
txt
b)
html or htm
c)
doc
d)
css
47.

Which of the following audio format is supported by HTML5?

a)

.ogg

b)

.wav

c)

.mp3

d)

All of the above

48.

In how many ways can CSS be written in?


a)

1

b)

2

c)

4

d)

3

49.

How can we write comments in CSS?

a)

/* */

b)

//

c)

#

d)

All of the above

50.

In the below code snippet, in what order will the margins be added?

p { margin: 25px 50px 75px 100px; }

a)

Top, Right, Bottom, Left

b)

Top, Left, Bottom, Right

c)

Top, Bottom, Right, Left

d)

Right, Left, Top, Bottom

51.

What are the different types of gradients in CSS?

a)

Linear Gradients

b)

Conic Gradients

c)

Radial Gradients

d)

All of the above

52.

Explain these protocols.

4 lines