Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Advanced HTML/CSS review

Total questions: 28

Worksheet time: 14mins

Name
Class
Date
1.

Assume you have two files for your website, and these files exist in the same folder:

home.html

style.css

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

a)

Inside home.html:

<head>

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

</head>

b)

Inside home.html:

<head>

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

</head>

c)

Inside style.css:

<html href="home.html">

d)

Inside style.css:

applyTo {

href: home.html; }

2.

Assume you have two files for your website, and these files exist in the same folder:

index.html

about.html

Which of the following is the proper way to link to the about.html page from the index.html page?

a)

<a href="about>About This Site</a>

b)

<a href="/about.html">About This Site</a>

c)

<a href="about.html">About This Site</a>

d)

<a href="/about">About This Site

3.

What are IFrames?

a)

Buttons that link to other websites

b)

Videos uploaded to your website

c)

The number of views your website has

d)

HTML pages embedded inside of other HTML pages that may contain video or other media

4.

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

5.

Which of the following correctly uses div to style multiple elements the same way?

a)

<div class="intro">

<h2>Welcome</h2>

<p>Hi, welcome to my page.</p>

</div>

b)

<div>

<h2 ="intro">Welcome</h2>

<p class="intro">Hi, welcome to my page.</p>

</div>

c)

<div>

.intro{

font-size: 16px;

font-style: italic;

}

<h2>Welcome</h2>

<p>Hi, welcome to my page.</p>

</div>

d)

<h2 div class="intro">Welcome</h2>

<p div class="intro">Hi, welcome to my page.</p>

6.

What is the difference between <span> and <div>?

a)

<span> is better for styling images, while <div> is better for styling specific text in the page

b)

<span> is for styling multiple elements, while <div> is for styling single elements at a time

c)

<span> is used to style inline elements such as a text in a paragraph, while <div> used to group elements together and creates a line break

d)

<span> is used to style elements, while <div> is used to embed parts of other websites

7.

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;

}

8.

How can I select all h1 tags that are immediate children of div tags?

a)

div h1 {

...

}

b)

div > h1 {

...

}

c)

div {

h1 {

...

}

}

d)

.h1 div {

...

}

9.

What is the reasoning behind the Don’t Repeat Yourself principle?

a)

It helps you stay under the HTML file character limit

b)

Repeated code makes it harder to read and edit

c)

HTML files with repeated code will take a very long time to load

d)

It makes a more clean and organized website for the user

10.

What are some ways to cut down on repetitive code in your website?

a)

Group together multiple selectors with commas

b)

Strategically plan ahead to make sure the site is coded concisely

c)

Use a div to style multiple elements

d)

All of the above

11.

Which of the following will turn the h1 tag blue as the mouse hovers over it?

a)

hover > h1 {

color: blue;

}

b)

h1:hover {

color: blue;

}

c)

h1; hover {

color: blue;

}

d)

h1 hover {

color: blue

}

12.

Which of the following will insert an exclamation point after every h2 element?

a)

h2:after {

content: “!”;

}

b)

h2:after {

content: !;

}

c)

h2::after {

content: “!”;

}

d)

h2::after {

content:;

}

13.

True or False: If a selector’s display property is set to none, selected elements will still take up space on the page.

a)

True

b)

False

14.

Which of the following is NOT a property that can hide the visibility of an element?

a)

opacity

b)

visibility

c)

hidden

d)

display

15.

Which of the following applies the invert filter to all images with the class “inverted”?

a)

.inverted {

filter: color(0;

}

b)

img.inverted {

filter: invert;

}

c)

img.inverted {

filter: invert(100%);

}

16.

Which of the following will result in a smooth transition from green to red as the mouse clicks on h1 tags?

a)

h1 {

color: green;

transition: color 2s;

}

h1:active {

color: red;

}

b)

h1 {

color: green;

transition: color 2s;

}

h1:hover {

color: red;

}

c)

h1 {

color: green;

}

h1:hover {

color: red;

}

d)

None of the above

17.

The Inspector would be a useful tool for which of the following tasks?

a)

Starting to write the HTML and CSS based on a design

b)

Testing what small CSS changes will do to the site presentation

c)

Finalizing changes made to the styling of the website

d)

None of the above

18.

Which of the following is NOT a part of the box model?

a)

padding

b)

border

c)

background-color

d)

margin

19.

For the given div, what is the size of the right padding?

div {

width: 10px;

height: 10px;

padding: 15px 10px 5px 20px;

}

a)

15px

b)

10px

c)

20px

d)

5px

20.

True or False: An image can have more than one CSS filter.

a)

True

b)

False

21.

Which of the following applies a grayscale filter to all images?

a)

img {

filter:: grayscale(100%);

}

b)

img {

filter: grayscale;

}

c)

img {

filter: grayscale(100%);

}

d)

img {

filter: grayscale(100);

}

22.

Which of the following defines the animation increase-font to change the font size from 5px to 20px?

a)

increase-font {

from {font-size: 5px;}

to {font-size: 20px;}

}

b)

keyframes increase-font {

font-size: {5px, 20px};

}

c)

@keyframes increase-font {

from {font-size: 5px;}

to {font-size: 20px;}

}

d)

@animation increase-font {

font-size: {5px, 20px};

}

23.

Which of the following applies an animation named grayscaleFilter over 10 seconds to every img tag?

a)

img {

animation-name: grayscaleFilter;

animation-length: 10s;

}

b)

img {

animation: grayscaleFilter 10s;

}

c)

img {

animation-name: grayscaleFilter;

length: 10 seconds;

}

d)

img {

animation: grayscaleFilter 10 seconds;

}

24.

img {

width: 100px;

height: 100px;

transition: width 2s, height 2s;

}

img:hover {

width: 200px;

height: 200px;

}

What would be the resulting difference if the line transition: width 2s, height 2s; was removed from the first CSS rule?

a)

Images would no longer get larger as the mouse hovers over them.

b)

The transition would happen over 10s, since this is the default duration.

c)

Images will no longer show up on the website.

d)

There would no longer be a smooth transition for the image:hover rule.

25.

True or False: You can only transition one property at a time.

a)

True

b)

False

26.

True or False: None of the changes you make in the Inspector will be saved.

a)

True

b)

False

27.

Which of the following defines border thickness so that the top and bottom borders are 10px thick and left and right borders are 5px thick?

a)

border: 5px 10px

b)

border: 5px 10px 5px 10px

c)

border: 10px 5px 10px 5px

d)

border: 5px 10px 5px

28.

Which of the following defines an animation change-color that changes the font color from green to red?

a)

@ change-color {

from {color: green;}

to {color: red;}

}

b)

@keyframes change-color {

from {color: green;}

to {color: red;}

}

c)

@keyframes change-color {

color: {color: green, red;}

}

d)

@animation change-color {

color: {color: green, red;}

}