Unit 3 Question Bank

This page includes several sample questions that could be used for assessment of students' understanding of the material covered in Unit 3. Questions are organized by module. Questions are coded in fully accessible, standards-compliant HTML and could easily be plugged into an HTML form that students could take online. However, this page itself is not a functional quiz. Use the Options below to display the questions how you need them before printing or copying.

Options

Module 1

Question 1

What does CSS stand for?
Correct answer: a. Cascading Style Sheets

Question 2

Which HTML element is used to define an internal style sheet?
Correct answer: d. <style>

Question 3

Which HTML attribute is used to set inline styles for a particular element?
Correct answer: c. style

Question 4

The three parts of a CSS style are:
Correct answer: b. selector, property, value

Question 5

Which of the following is the correct style declaration for setting the font size of the body element?
Correct answer: b. body { font-size: 1em; }

Question 6

In the preceding question, if you were to change 1em to 2em, you would be changing the—
Correct answer: d. Value

Question 7

Assuming your style sheet is named mystyle.css, which of the following is correct?
Correct answer: c. <link type="text/css" rel="stylesheet" href="styles/mystyle.css">

Question 8

Which of the following is an advantage to using an external style sheet?
Correct answer: c. Both a and b

Question 9

In CSS, "em", "%" and "px" are—
Correct answer: c. Units of measure, but "em" and "%" are relative, and "px" is absolute.

Module 2

Question 1

The hex triplet is a six-digit number, where each pair of digits represents (in order) the value of—
Correct answer: b. red, green, blue

Question 2

If FF represent the highest value of a particular color and 00 represents the lowest value of a color, what color will this hex triplet code produce: #FF0000?
Correct answer: a. red

Question 3

Black by definition has no color; its hex triplet code is which of the following?
Correct answer: b. #000000

Question 4

White by definition has no color; its hex triplet code is which of the following?
Correct answer: a. #FFFFFF

Question 5

How do you add a comment to your CSS code?
Correct answer: d. /* this is a comment */

Question 6

Which property is used to change the background color in CSS?
Correct answer: d. background-color

Question 7

Which property is used to change the color of text in CSS?
Correct answer: a. color

Question 8

How do you set the background color for <h1> elements?
Correct answer: b. h1 { background-color: #FF0000 }

Question 9

Which of the following uses correct CSS syntax?
Correct answer: c. body {color: black}

Module 3

Question 1

Which of the following is techniques would help you to test the contrast between text and background?
Correct answer: b. Capture your screen to an image file, then open the file in image editing software and convert the image to grey-scale.

Question 2

One of the best ways to differentiate content is to show hierarchy by varying font size.
Correct answer: a. True

Question 3

Which of the following font families has small lines or strokes that extend from the ends of characters?
Correct answer: a. serif

Question 4

Which of the following font families is more simple and is without small lines or strokes that extend from the ends of characters?
Correct answer: b. sans-serif

Question 5

When the "font-family" property has a list of fonts as its value—
Correct answer: d. All of the above

Question 6

What is the correct CSS syntax for making <p> elements bold?
Correct answer: d. p {font-weight:bold}

Question 7

The CSS property for positioning text either left, right, or center is—
Correct answer: a. text-align

Question 8

Which CSS property is used to change the font of an element?
Correct answer: d. font-family

Question 9

Which CSS property controls the text size?
Correct answer: c. font-size

Question 10

Which CSS property is used to define the spacing between text characters?
Correct answer: c. letter-spacing

Question 11

Which CSS property is used to define the space between words?
Correct answer: a. word-spacing

Question 12

Consider the following CSS:
h1,h2,h3  {
  font-family: Rockwell, "Times New Roman", serif;
}
Which of the following is true as a result of this code?
Correct answer: b. h1, h2, and h3 elements will have Rockwell as the first choice font.

Question 13

How do you make each word start with a capital letter?
Correct answer: a. text-transform: capitalize

Module 4

Question 1

In the box model there are three layers surrounding content in the following order (starting with the layer closest to the content)
Correct answer: d. padding, border, margin

Question 2

How do you change the left margin of an element in CSS?
Correct answer: d. margin-left

Question 3

How do you display a margin with these settings?
  • Top margin = 10 pixels
  • Bottom margin = 5 pixels
  • Left margin = 20 pixels
  • Right margin = 1 pixel
Correct answer: b. margin: 10px 1px 5px 20px

Question 4

You can specify one value for padding, border, or margin (for example, padding:5px) and that value will apply to all four sides of the box.
Correct answer: a. True

Question 5

The border-style property can have several values but not
Correct answer: b. oval

Question 6

How do you display a border radius (a box with rounded corners)?
Correct answer: a. border:2px solid; border-radius:25px;

Module 5

Question 1

Complete this analogy: id is to individual elements as class is to—
Correct answer: c. groups of elements

Question 2

Which is a valid reason for assigning an id attribute to an HTML element?
Correct answer: d. All of the above.

Question 3

To add style to an element with an id, you preface the id in CSS with which of the following symbols?
Correct answer: a. #

Question 4

Given the HTML <p id="alert">, which of the following CSS selectors would reference this specific element?
Correct answer: e. Both a and c

Question 5

To add style to an element with a class, you preface the class in CSS with which of the following symbols?
Correct answer: d. period

Question 6

Which statement is true about descendant selectors?
Correct answer: b. They enable you to stylize one element nested inside another element.

Question 7

The :hover pseudo-class makes it possible to stylize an element differently when a mouse user is hovering over that element. Which pseudo-class makes it possible to achieve the same effect for keyboard users as they tab to an element?
Correct answer: a. Focus

Question 8

CSS pseudo-class selectors can produce interesting typographic effects such as stylizing the first letter of a text so it appears larger with a unique font.
Correct answer: a. True