Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Review for CSS Test

Total questions: 12

Worksheet time: 5mins

Name
Class
Date
1.

Why do we use CSS?

a)

Easily modify the look and feel of a web site even at a large scale

b)

Separate the content of a web page from the design of a web page

c)

HTML wasn’t intended to be able to style web pages, CSS allows us to add style

d)

All of the above

2.

Which of the following is a valid CSS rule?

a)

h1 {

color: blue;

}

b)

style="color:blue;"

c)

h1 {

color {

blue;

}

}

d)

css="color:blue;"

3.

Which of the following is a valid CSS rule?

a)

<h1> {

color: orange

}

b)

h1 {

color: orange;

}

c)

h1

<color="orange">

d)

h1 {

color="orange";

}

4.

Which of the following code snippets will select all HTML elements with the class “alert” and set their color to be red?

a)

#alert {

color: red;

}

b)

class="alert" {

color: red;

}

c)

alert {

color: red;

}

d)

.alert {

color: red;

}

5.

Which of the following CSS rules will select the HTML element with the id logo and set the font size for that element to 60 pixels?

a)

.logo {

font-size: 60px;

}

b)

#logo {

font-size: 60px;

}

c)

id="logo" {

font-size: 60px

}

d)

logo {

font-size: 60px;

6.

What is the function of the Cascade in CSS?

a)

The Cascade will make sure there are no typos in your CSS rules.

b)

The Cascade determines which CSS rules will be applied when multiple rules for an item are contradictory.

c)

The Cascade helps you write styling for your websites quickly by providing easy templates to use.

d)

The Cascade is a set of guidelines to make your site look beautiful.

7.

Which of the following code snippets will select all <img> tags on a page and give them a height of 200 pixels?

a)

tag="img" {

height: 200px;

}

b)

<img> {

height: 200px;

}

c)

<img style="height:200px;">

d)

img {

height: 200px;

}

8.

CSS rules have a selector that defines which HTML elements the rule applies to.

We’ve learned about the following CSS Selectors:

Select by tag name, Select by class name, and Select by id name.

Which of the following ranks the selectors from highest precedence to lowest precedence?

a)

Select by tag name, select by class name, select by id name

b)

Select by id name, select by tag name, select by class name

c)

Select by id name, select by class name, select by tag name

d)

Select by class name, select by id name, select by tag name

9.

True or False: In the case that two conflicting rules have the same order and specificity, the rule that is written first will be applied.

a)

True

b)

False

10.

Suppose you have the following CSS rules:

p { color: green; }

.fire { color: red; }

#title { color: blue; }

What font color will the following HTML element have after being styled by the given CSS:

<h1 class="fire"> Welcome! </h1>

a)

black

b)

green

c)

blue

d)

red

11.

Suppose you have the following CSS rules:

p { color: green; }

.fire { color: red; }

#title { color: blue; }

What font color will the following HTML element have after being styled by the given CSS:


<p class="fire" id="title"> Hello World! </p>

a)

black

b)

red

c)

blue

d)

green

12.

Which of the following statements are true about styling your web pages with CSS:

I. Styling with CSS is more organized than using style= on each HTML tag that you want to style

II. You can not create styles with CSS that are not possible using style= on an HTML tag

a)

II only

b)

Neither I nor II

c)

I only

d)

I and II