Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook

(Nora) #1

202 CHAPTER 4 Getting started with CSS3


Answers


This section contains the answers to the lesson review questions in this chapter.

Lesson 1



  1. Correct answer: C
    A. Incorrect: //temporary is a comment for programming languages such as C, C++,
    and C#, but it’s not applicable in a style sheet.
    B. Incorrect: --temporary is a SQL Server comment, not a style sheet comment.
    C. Correct: The block comment syntax, / temporary /, can make an entire block of
    text into a comment.
    D. Incorrect: rem temporary is a DOS batch file comment, but it’s not applicable to
    style sheets.

  2. Correct answer: C
    A. Incorrect: Inline styles do not provide any separation because they are defined on
    the HTML element.
    B. Incorrect: Embedded styles provide little separation because they are located in
    the HTML element.
    C. Correct: External style sheets provide the best separation because the style rules
    are in a separate file from the HTML document.
    D. Incorrect: The @import statement is used in external style sheets to import styles
    into the style sheet. This provides reuse functionality. The @import statement can-
    not be used in the HTML document.

  3. Correct answer: B
    A. Incorrect: The rel attribute specifies the relationship between the HTML document
    and the linked file.
    B. Correct: The media attribute is required to specify the style sheet usage.
    C. Incorrect: Using the printer.css name has no bearing on the usage of the file.
    D. Incorrect: The target attribute typically specifies the frame the link will target.


Lesson 2



  1. Correct answer: A
    A. Correct: The first part of the selector locates the element with id of readingPane
    while the second part of the selector locates all paragraph elements, and then
    returns the first letter of each paragraph so the style can be applied to it.

Free download pdf