Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook

(Nora) #1

164 CHAPTER 4 Getting started with CSS3


Lesson review


Answer the following questions to test your knowledge of the information in this lesson. You
can find the answers to these questions and explanations of why each answer choice is correct
or incorrect in the “Answers” section at the end of this chapter.


  1. You want to set the style of the first letter of every paragraph in a
    element
    whose id is readingPane. Which style selector is most appropriate?
    A. #readingPane p::first-letter
    B. #readingPane::first-letter
    C. #readingPane p:first-child
    D. #readingPane:first-child

  2. The following style sheet rule is defined in Corporate.css.
    div p.highlight{
    font-size: xx-large;
    background-color: yellow;
    }


In Department.css, the following style sheet rule is defined.
div p {
background-color: blue;
}

Your HTML document contains the following.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link href="Corporate.css" rel="stylesheet" />
<link href="Department.css" rel="stylesheet" />
</head>
<body>
<div id="readingPane">
<p class='highlight'>
Here is a test to see what the background color of a paragraph
will be blue or yellow.
</p>
</div>
</body>
</html>

What will be the rendered background color of the paragraph?
A. Yellow
B. Blue
C. Transparent
D. White
Free download pdf