wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CSS- Styling Websites

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

CSS stands for _____________________

a)

Cascading Style Sheets

b)

Cascading Style Samples

c)

Changing Style Sheets

d)

Changing Slide Shows

2.

CSS is the language for ____________

a)

creating and styling web pages

b)

searching the internet

c)

designing web pages and adding style

d)

creating colorful web pages

3.

Why do we use CSS?

a)

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

b)

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

c)

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

d)

All of the above

4.

Which of the following is a valid CSS rule?

a)

h1 {

color: blue;

}

b)

style="color:blue;"

c)

css="color:blue;"

d)

h1 {

color {

blue;

}

}

5.

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

a)

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

b)

tag="img" {

height: 200px;

}

c)

img {

height: 200px;

}

d)

<img> {

height: 200px;

}

6.

A selector defines __________

a)

which HTML elements a CSS rule applies to.

b)

which URL elements an HTML applies to.

c)

which CSS elements apply to HTML

d)

which CSS elements apply to CodeHS

7.

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)

.alert {

color: red;

}

c)

#alert {

color: red;

}

d)

class="alert" {

color: red;

}

8.

_____________ is an attribute we can add to HTML tags in order to style a specific group of elements.

a)

Style

b)

Identity

c)

Class

d)

Worth

9.

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)

#logo {

font-size: 60px;

}

d)

id="logo" {

font-size: 60px;

}

10.

____________ is an attribute we can add to an HTML tag to style that specific element.

a)

ID

b)

AD

c)

BC

d)

HI

11.

What is the function of the Cascade in CSS?

a)

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

b)

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

c)

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

d)

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

12.

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

13.

In what order does the Cascade look at factors to determine which CSS rule to follow?

a)

Order, Importance, Specificity

b)

Importance, Order, Specificity

c)

Specificity, Importance, Order

d)

Importance, Specificity, Order

14.

Which of the following is a valid CSS rule?

a)

h1 {

color: blue;

}

b)

<h1> {

color: blue;

}

c)

h1 {

color="blue";

}

d)

h1 {

color=blue;

}

15.

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
  • 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

16.

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

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

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

a)

I only

b)

II only

c)

I and II

d)

Neither I nor II

17.

Suppose you have written a web page using HTML and CSS and it is hosted at the URL yourdomain.com/home.html

Which of the following statements is true about which devices can view your website?

a)

Only browsers on desktop computers can view your website because only desktop browsers can render HTML based web pages.

b)

Only browsers on mobile phones can view your website because only mobile browsers can render HTML based web pages.

c)

Only computers made after the day you publish your website can view your website. Older computers can’t understand HTML and CSS.

d)

Any browser on any device will be able to view your webpage, because all browsers and devices on the Internet agree to use the same protocols for sending, receiving, and viewing webpages.

18.

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)

red

b)

green

c)

blue

d)

black

19.

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="title">My First Paragraph</p>

a)

red

b)

green

c)

blue

d)

black

20.

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)

red

b)

green

c)

blue

d)

black