wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Web Design with HTML: CSS Styling

Total questions: 17

Worksheet time: 9mins

Name
Class
Date
1.

Which of the following HTML code snippets is the proper way to set the background color of an <h1> tag to be blue?

a)

<blue> <h1>Hello</h1> </blue>

b)

<h1 background-color="blue">Hello</h1>Windows

c)

<h1 style="blue">Hello</h1>Twitter

d)

<h1 style="background-color:blue;">Hello</h1>

2.

Which of the following is a valid color in HTML?

a)

“blue”

b)

“rgb(255, 0, 0)”

c)

“#00FF00”The list on a webpage

d)

All of the aboveThe title of the webpage

3.

All of the colors you see on a computer screen are the result of a mixture of the same three colors. What are those colors?

a)

red, yellow, blue

b)

green, orange, purple

c)

red, green, blue

d)

red, green, yellow

4.

Which of the following is the proper format for an HTML tag?

a)

>h1<Content Affected by Tag >/h1<

b)

<h1>Content Affected by Tag<h1>

c)

<h1 Content Affected by Tag />

d)

<h1>Content Affected by Tag</h1>

5.

Which of the following best describes the difference between the domain and path of a URL?

a)

The domain specifies where the browser’s request should be sent.

The path specifies exactly what file is being requested.

b)

The domain specifies what kind of file is being requested.

The path specifies the name of the file being requested.

c)

The domain specifies the name of the file being requested.

The path specifies what kind of file is being requested.

d)

The domain specifies exactly what file is being requested.

The path specifies where the browser’s request should be sent.

6.

Which of the following classifies as metadata about a webpage?

a)

The tags that make up the body of the webpage

b)

The title of the webpage

c)

A list on a webpage

d)

A table on a webpage

8.

What is the result of the following HTML code:

<ol> <li>Bread</li> <li>Milk</li> <li>Eggs</li> </ol>

a)

* Bread

* Milk

* Eggs

b)

– Bread

– Milk

– Eggs

c)

1. Bread

2. Milk

3. Eggs

d)

a. Bread

b. Milk

c. Eggs

9.

Suppose you are making a music streaming website and you want to make a page that displays a user’s music library.

Which of the following is the proper HTML code to create the following table:

a)

<table border="1"> <tr> <td>Title</td> <td>Artist</td> <td>Length</td> </tr> <tr> <td>CD Jam</td> <td>Rooney Pitchford</td> <td>3:55</td> </tr> <tr> <td>Memory</td> <td>Tom Misch</td> <td>5:41</td> </tr> </table>

b)

<table border="1"> =<tr> <th>Title</th> <th>Artist</th> <th>Length</th> </tr> <tr> <td>CD Jam</td> <td>Rooney Pitchford</td> <td>3:55</td> </tr> <tr> <td>Memory</td> <td>Tom Misch</td> <td>5:41</td> </tr> </table>

c)

<table border="1"> <tr> <th>Title</th> <th>CD Jam</th> <th>Memory</th> </tr> <tr> <td>Artist</td> <td>Rooney Pitchford</td> <td>Tom Misch</td> </tr> <tr> <td>Length</td> <td>3:55</td> <td>5:41</td> </tr> </table>

d)

<table border="1">> <tr> <th>Title</th> <td>CD Jam</td> <td>Memory</td> </tr> <tr> <th>Artist</th> <td>Rooney Pitchford</td> <td>Tom Misch</td> </tr> <tr> <th>Length</th> <td>3:55</td> <td>5:41</td> </tr> </table>

10.

Suppose you have written a web page using HTML 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)

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.

b)

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

c)

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

d)

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

11.

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

12.

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

13.

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 style="height:200px;">

c)

<img> { height: 200px; }

d)

img { height: 200px; }

14.

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

15.

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

16.

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)

class="alert" { color: red; }

d)

.alert { color: red; }

17.

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