wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CodeHS Unit 5

Total questions: 26

Worksheet time: 14mins

Name
Class
Date
1.
Within which tags on the HTML page is the main content placed?
a)
<head>
b)
<style>
c)
<html>
d)
<body>
2.
Which tag is used to add a picture to a web-page?
a)
<graphic>
b)
<img>
c)
<pic>
d)
<picture>
3.
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
4.
Which is correct CSS syntax? 
a)
{ body; color=black;}
b)
body: color= black
c)
body {color:black;}
d)
(body color is black) 
5.

Both the head and body tag pairs are located within the HTML tag pair. This situation is known as ______________.

a)

tagging

b)

pairing

c)

nesting

d)

joining

6.
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 (-)
7.
The code for the comment tag in CSS is
a)
<!-- comment -->
b)
<!-- comment >
c)
/* comment /*
d)
/* comment */
8.

True or False: It is possible to embed any website inside IFrames.

a)

True

b)

False

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 of the following selects all p tags with the class alert and makes them red?

a)

p.alert {

color: red;

}

b)

p {

.alert {

color:red;

}

}

c)

.alert p{

color: red;

}

d)

p alert{

color: red;

}

11.

Which attribute contains the URL to a linked web page?

a)

href

b)

type

c)

src

d)

name

12.
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>
13.

Orville is working on a Web page for his company’s site. He wants to insert an HTML comment within the page to let other developers know that the page validates as HTML and that he is the page author. Which line of code will insert the comment Orville requires?

a)

<!- - Orville Davis, 9/17/2012. This code validates to HTML5- - >

b)

/* Orville Davis, 9/17/2012. This code validates to */

c)

// Orville Davis, 9/17/2012. This code validates to

d)

<? Orville Davis, 9/17/2012. This code validates to ?>

14.

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;}

15.

Which of these will select all paragraphs that are inside of a div element?

a)

div p

b)

p div

c)

p > div

d)

div > p

16.
CSS instructions can be:
-Applied inline to individual HTML elements on an HTML page.
-Embedded within an HTML page to affect all specified elements on that page.
-Collected in an external file that is linked to multiple HTML pages.
a)
True
b)
False
17.
What is the order of precedence for CSS?
a)
External styles override embedded styles.
b)
External styles overrides all other styles.
c)
Internal styles override inline styles.
d)
Inline styles override all other styles.
18.
Which selector indicates this element?
<a id="top">Top</a>
a)
.top { }
b)
#top { }
c)
*top { }
d)
top { }
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.
What does CSS stand for? 
a)
Creative Style Sheets
b)
Cascading Style Sheets
c)
Colorful Style Spread
d)
Computer Style Spread
21.

All of the following are a part of the box model EXCEPT

a)

radius area

b)

padding area

c)

margin area

d)

content area

22.

What is the area between the content and the border?

a)

padding

b)

margin

c)

height

d)

width

23.

What is the outermost area of the CSS Box Model?

a)

margin

b)

padding

c)

border

d)

width/height

24.

Which model includes margin, border, padding, and content?

a)

CSS Box model

b)

CSS3 Flexbox Box model

c)

CSS3 Grid Layout model

d)

CSS Grid Template Layout Module

25.

Which of the following would you use an IFrame for?

a)

Embedding a map from Google Maps in your website

b)

Adding an image to your website

c)

Changing an image’s opacity when the user hovers over the image

d)

Adding a filter to an image on your website

26.

Which of the following selects images as the mouse hovers over them and sets their size to 350px by 350px?

a)

img:hover {

width: 350px;

height: 350px;

}

b)

img & hover {

width: 350px;

height: 350px;

}

c)

img::hover {

width: 350px;

height: 350px;

}

d)

img > hover {

width: 350px;

height: 350px;

}