wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CodeHS Div & Spans

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.
You should save HTML files with which file extension?
a)
.htm
b)
.index
c)
.webpage
d)
.html
2.
Within which tags on the HTML page is the main content placed?
a)
<head>
b)
<style>
c)
<html>
d)
<body>
3.
Which tag is used to create a hyperlink?
a)
<a>
b)
<u>
c)
<b>
d)
<i>
4.
Which tag is used to add a picture to a web-page?
a)
<graphic>
b)
<img>
c)
<pic>
d)
<picture>
5.
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
6.
Which is correct CSS syntax? 
a)
{ body; color=black;}
b)
body: color= black
c)
body {color:black;}
d)
(body color is black) 
7.
If you want to have more than one property for a CSS selector, what character separates them?
a)
comma (,)
b)
semi-colon (;)
c)
colon (:)
d)
dash (-)
8.
The code for the comment tag in CSS is
a)
<!-- comment -->
b)
<!-- comment >
c)
/* comment /*
d)
/* comment */
9.

What is the function of the div tag?

a)

To define a section of an HTML page

b)

To group a block of elements together to format them with CSS

c)

To efficiently apply the same style to several different elements

d)

All of the above

10.
Which code should a web developer use to attach an external CSS Style Sheet to an HTML webpage?
a)
<link rel="stylesheet" type="text/css" href="styles.css">
b)
<link rel=stylesheet type=css href=styles.css>
c)
<style ref="stylesheet" type="css" href="styles.css">
d)
<style ref=stylesheet type=text/css href=syb/syb.css>
11.

The <span> tag.........

a)

is used to group inline-elements in a document.

b)

provides no visual change by itself

c)

provides a way to add a hook to a part of a text or a part of a document.

d)

All the above

12.

True or False: By default, browsers always place a line break before and after the <div> element.

a)

True

b)

False

13.
What symbols go around the properties for each CSS selector?
a)
< >
b)
[ ]
c)
{ }
d)
( )
14.
Which is the value in this CSS?
p {color: red;}
a)
p
b)
color
c)
red
15.

Which of these selects all page elements?

a)

#

b)

.

c)

*

d)

&

16.
CSS benefits include:
a)
401K
b)
Consistency & Easy Change Management
c)
Cruise Control
d)
Free baked beans for life
17.
.my {color:red;} is a 
a)
element selector
b)
id selector
c)
class selector
d)
attribute selector
18.
#my {color:red} is an
a)
element selector
b)
id selector
c)
class selector
d)
attribute selector
19.

If you wanted to select both h2 and h4 elements to change the font style to italic, which code would you use?

a)

.h2 {font-style: italic;}

b)

h2 h4 {font-style: italic;}

c)

h2 + h4 {font-style: italic;}

d)

h2 & h4 {font-style: italic;}

20.

if you wanted to select the sibling h4 tag after an h2 tag, what code would you selectj?

a)

h2 then h4 {font-style: italic;}

b)

h2 + h4 {font-style: italic;}

c)

h2, h4 {font-style: italic;}

d)

h2 after h4 {font-style: italic;}