Professional Documents
Culture Documents
MULTIPLE CHOICE
1. If you have several Web pages and need a consistent style that can be easily updated, ____ is a good
choice.
a. DHTML c. XML
b. CSS d. both a and c
ANS: B PTS: 1 REF: HTML 326
3. A(n) ____ statement must be inserted into all Web pages in which you want to use an external style
sheet.
a. index c. link
b. connect d. attach
ANS: C PTS: 1 REF: HTML 326
6. A style ____ is a series of rules that defines the style for a Web page or an entire Web site.
a. grid c. document
b. sheet d. table
ANS: B PTS: 1 REF: HTML 327
7. A(n) ____ style sheet is used to change the style within an individual HTML tag.
a. embedded c. inline
b. external d. dynamic
ANS: C PTS: 1 REF: HTML 330
8. Which of the following kinds of style sheets are overridden by inline styles?
a. embedded c. neither a nor b
b. external d. both a and b
ANS: D PTS: 1 REF: HTML 330
9. A(n) ____ style sheet is used to change the style of one Web page.
a. embedded c. inline
b. external d. dynamic
ANS: A PTS: 1 REF: HTML 330
10. A(n) ____ style sheet is used to change the style of multiple pages in a Web site.
a. embedded c. inline
b. external d. dynamic
ANS: B PTS: 1 REF: HTML 330
11. For Web pages in which you want a common look, use ____ style sheets.
a. embedded c. inline
b. external d. dynamic
ANS: B PTS: 1 REF: HTML 330
12. If you want to change the style of one or a few sections of a single Web page, then using ____ style
sheets is the most appropriate
a. embedded c. inline
b. external d. dynamic
ANS: C PTS: 1 REF: HTML 330
13. The ____ property is a good way to add additional space between words.
a. tracking c. kerning
b. leading d. word-spacing
ANS: D PTS: 1 REF: HTML 333
14. The code for an embedded style sheet must be inserted between start and end ____ tags.
a. <style> c. comment
b. <format> d. <css>
ANS: A PTS: 1 REF: HTML 333
15. Within the style tag container, Web developers generally follow the coding practice to add HTML
____ tags.
a. index c. comment
b. body d. format
ANS: C PTS: 1 REF: HTML 333
16. Which of the following is NOT a way to add the line-height value?
a. by number c. by length
b. by percentage d. by style
ANS: D PTS: 1 REF: HTML 335
17. If you specify line-height by number, the browser uses the ____ property to determine the space.
a. font-size c. line-space
b. line-size d. tracking
ANS: A PTS: 1 REF: HTML 335
19. In the padding property statement, padding: 25px 50px 75px 100px; the top padding is ____.
a. 100px c. 50px
b. 75px d. 25px
ANS: D PTS: 1 REF: HTML 335
20. In the padding property statement, padding: 25px 50px 75px; the left padding is ____.
a. 100px c. 50px
b. 75px d. 25px
ANS: C PTS: 1 REF: HTML 335
21. The ____ is a very useful unit in CSS because it adapts automatically to the font size that the Web
page visitor uses.
a. ex c. pica
b. em d. point
ANS: B PTS: 1 REF: HTML 336
24. The measurement x-height is usually about ____ the font size.
a. one-eighth c. half
b. one-quarter d. double
ANS: C PTS: 1 REF: HTML 336
27. If you do not use the ____ property, the elements display on the Web page in the order in which they
appear.
a. order c. placement
b. index d. position
ANS: D PTS: 1 REF: HTML 337
28. The ____ code sets the style so that the Web page element remains constant and does not move.
a. placement: fixed c. order: absolute
b. index: permanent d. position: absolute
ANS: D PTS: 1 REF: HTML 337
30. The ____ property value generates an absolutely positioned element, positioned relative to the first
parent element that has a position other than static.
a. absolute c. fixed
b. relative d. static
ANS: A PTS: 1 REF: HTML 338
31. The ____ property value generates an absolutely positioned element, positioned relative to the browser
window.
a. absolute c. fixed
b. relative d. static
ANS: B PTS: 1 REF: HTML 338
32. The ____ property value generates a relatively positioned element, positioned relative to its normal
position.
a. absolute c. fixed
b. relative d. static
ANS: C PTS: 1 REF: HTML 338
33. The ____ property value places the element in the normal flow.
a. absolute c. fixed
b. relative d. static
ANS: D PTS: 1 REF: HTML 338
35. You can specify font-weight using numerical values from ____.
a. 1 to 10 c. 100 to 1000
b. 100 to 900 d. 1000 to 5000
ANS: B PTS: 1 REF: HTML 341
36. With the font-weight property, normal text that is not bold has a value of ____.
a. 4 c. 400
b. 40 d. 4000
ANS: C PTS: 1 REF: HTML 341
37. With external style sheets, the link statement is placed between the ____ tags.
a. <html> </html> c. <head> </head>
b. <body> </body> d. <css> </css>
ANS: C PTS: 1 REF: HTML 342
38. You can set specific styles using the ____ tags.
a. <div> </div> c. <css> </css>
b. <set> </set> d. <format> </format>
ANS: A PTS: 1 REF: HTML 343
39. The ____ model describes the structure of the elements that are displayed on the Web page.
a. space c. visual
b. spatial d. box
ANS: D PTS: 1 REF: HTML 343
MULTIPLE RESPONSE
1. Using HTML tags and CSS to change the way a Web page appears in a Web browser, such as adding
____, is known as the style of the Web page.
a. italic c. colors
b. headings d. tables
ANS: A, B, C, D PTS: 1 REF: HTML 324
2. If a style is intended for most (or all) of the Web pages on a Web site, you may want to use a(n) ____
style sheet.
a. dynamic c. external
b. embedded d. inline
ANS: B, C PTS: 1 REF: HTML 330
3. Which of the following is a length unit used with the word-spacing property?
a. inches c. centimeters
b. points d. picas
ANS: A, B, C, D PTS: 1 REF: HTML 333
4. Which of the following is a unit of measurement you can use with the line-height property?
a. inch c. em
b. pt d. ex
ANS: B, C PTS: 1 REF: HTML 335
5. You can use shorthand properties with ____.
a. padding c. borders
b. margins d. fonts
ANS: A, B, C, D PTS: 1 REF: HTML 335
MODIFIED TRUE/FALSE
1. For Web sites with many Web pages that have a common look, a(n) embedded style sheet may be the
best option. _________________________
ANS: F, external
ANS: F, external
3. The embedded style sheet is good to use if you want the style to affect one (or a few) Web pages, and
not all pages across the Web site. _________________________
4. With the line-height property, you can control the horizontal spacing between lines of text.
_________________________
ANS: F, vertical
ANS: F, 1em
TRUE/FALSE
1. Although CSS allows Web developers to make changes to the design of a Web page, CSS is limited in
its ability to define the appearance, or style, across one or more Web pages.
2. CSS is rarely used for formatting Web pages with tabular material because it is ill-suited to the task.
3. External style sheets override inline styles and embedded style sheets.
ANS: F PTS: 1 REF: HTML 330
4. The greatest benefit of CSS is the ability to identify a style across a Web site.
5. If there are styles that are to be repeated in a particular Web page (or in a few pages), you would be
better off using an inline style sheet rather than an embedded style sheet.
6. If you want all paragraphs of text to have the same style within one Web page, then it makes more
sense to embed that style rather than add the style to each paragraph tag within the Web page.
7. If you find that the style from an embedded style sheet is used on more Web pages as time goes on,
you should create an external style sheet and link it into all Web pages in which you had previously
inserted an embedded style sheet.
8. HTML <style> tags are often used to hide any script language that an older browser cannot interpret.
11. The ex unit adapts automatically to the font size that the Web page visitor uses.
12. The hover technique used for links adds a bit of interactivity and can be used to help highlight the
menu and submenu structure for the user.
13. With the font-weight property, each larger number is at least as bold as the one above it.
14. With the font-weight property, 100 is the boldest option of the font.
15. The user determines how bold each font-weight value is as he or she displays the Web page.
17. Determining an effective structure of your Web pages involves correctly determining the box model
controls.
18. You can find an abundance of information on the box model troubleshooting tools like those in
Firebug or Google Chrome's Developer Tools.
19. The general format of the <link> tag is <link rel="stylesheet" type="css" href="sheetname.css" />.
20. To link a style sheet to a Web page, the <link> tag must use "text/css" as the value for the type
property.
21. In the tag, <link rel="stylesheet" type="css" href="sheetname.css" />, the external style sheet is located
in the main or root directory of the Web site.
22. Paged media is the same as continuous media in that the content of the document is not split into one
or more discrete pages.
23. When Web site visitors print a Web page, they generally want to print the content of the Web page,
which would include a navigation menu bar, for example.
24. You can limit what prints by creating an external style sheet that is used specifically to se the styles for
a printed Web page.
25. Page selectors give a Web developer the flexibility to designate the first page, all left pages, or all right
pages.
COMPLETION
1. With ____________________ you can establish a standard look for all Web pages on a Web site.
ANS:
CSS
Cascading Style Sheets
Cascading Style Sheets (CSS)
CSS (Cascading Style Sheets)
2. The CSS ____________________ property gives you the ability to control line height.
ANS: line-height
ANS: shorthand
ANS:
px
pixel
ANS: px
6. To expand the possibilities of CSS, you can use ____________________ (e.g., the link hover).
ANS: pseudoclasses
ANS: pseudoclasses
ANS: position
9. The ____________________ property value specifies that the value of the position property should be
inherited from the parent element.
ANS: inherit
10. In the box model, the ____________________ is the space between the content of the element and the
box border.
ANS: padding
11. In the box model, the ____________________ specifies the space between the element and other
content on the Web page.
ANS: margin
12. In the box model, the ____________________ is what surrounds the element content.
ANS: border
13. Once you have positioned the ____________________ on the Web page, you can control its
appearance by manipulating its padding, borders, and margins.
ANS: box
14. To link a style sheet to a Web page, the <link> tag must use "____________________" as the value
for the rel property.
ANS: stylesheet
15. A(n) ____________________ is a rectangular region that contains two areas: the page area and the
margin area.
16. The ____________________ area includes the elements (or boxes) laid out on the page.
ANS: page
17. The ____________________ area surrounds the page area, and is transparent.
ANS: margin
18. Web developers can specify the margins of a page box inside a(n) ____________________ rule.
ANS: @page
19. A(n) ____________________ rule contains the keyword @page, followed by an optional page
selector, followed by a block of declarations.
ANS: @page
20. Using the ____________________ rule gives you the flexibility that you need in controlling printing
of a Web page.
ANS: @page
MATCHING
Identify the letter of the choice that best matches the phrase or definition.
a. inline f. shorthand
b. embedded g. @page rule
c. external h. page box
d. pseudoclass i. page area
e. box model j. margin area
1. A rectangular region that contains two areas: the page area and the margin area
2. Used to add special effects to some selectors
3. Property that allows a Web developer to shorten the code
4. Contains a keyword, followed by an optional page selector, followed by a block of declarations
5. Used to change the style of one Web page
6. Includes the elements (or boxes) laid out on the page
7. Used to change the style within an individual HTML tag
8. Describes the structure of the elements that are displayed on the Web page
9. Used to change the style of multiple pages on a Web site
10. Surrounds the page area
ESSAY
1. Briefly list and define the position property values, defining each.
ANS:
absolute: Generates an absolutely positioned element, positioned relative to the first parent element
that has a position other than static
fixed: Generates an absolutely positioned element, positioned relative to the browser window
relative: Generates a relatively positioned element, positioned relative to its normal position, so “left:
10” adds 10 pixels to the element’s left position
static: Default; no position; the element occurs in the normal flow
inherit: Specifies that the value of the position property should be inherited from the parent element
2. Explain the box model. Be sure to define all appropriate terms in your explanation.
ANS:
When structuring your Web pages, it is also useful to understand the concept of the box model. The
box model describes the structure of the elements that are displayed on the Web page. Once you have
positioned the box on the Web page, you can control its appearance by manipulating its padding,
borders, and margins. The margin specifies the space between the element and other content on the
Web page. The border is what surrounds the element content. The padding is the space between the
content of the element and the box border. These four elements (content, padding, border, and margin)
determine how the element content is displayed in the browser.
3. Explain the page box model, making sure to define all relevant terms in your response.
ANS:
A page box is a rectangular region that contains two areas: the page area and the margin area. The page
area includes the elements (or boxes) laid out on the page. The margin area surrounds the page area;
the page margin area is transparent. Web developers can specify the margins of a page box inside an
@page rule. An @page rule contains the keyword @page, followed by an optional page selector,
followed by a block of declarations. Page selectors give a Web developer the flexibility to designate
the first page, all left pages, or all right pages. For instance, you could specify different margins for the
first printed page of a Web site.
CASE
Libby has been charged with the task of making a series of changes to the Web site of her employer.
To do so, she decides to take advantage of Cascading Style Sheets (CSS). For each change, she needs
to choose between the three types of CSS: inline, embedded, and external.
1. Which of the following changes would Libby be most likely to implement using an embedded CSS?
a. adding a drop-down menu that will appear on all of the pages of the Web site
b. creating a separate style that will be used when users print any of the pages of the Web site
c. changing the font style and size for a single paragraph on the Web site's home page
d. creating a new style that appears on a single page of the Web site
ANS:
D
2. Which of the following changes would Libby be most likely to implement using an inline CSS?
a. adding a drop-down menu that will appear on all of the pages of the Web site
b. creating a separate style that will be used when users print any of the pages of the Web site
c. changing the font style and size for a single paragraph on the Web site's home page
d. adding a pop-up feature to multiple images that appear on a single page of the Web site
ANS:
C
Ben is using a Cascading Style Sheet to define a menu bar that will appear on his Web site. Among
other things, he needs to define the padding that will be used for the text on the menu.
3. Ben wants to specify the padding as a multiple of the current font size. For example, he wants one of
the padding values to be 0.5 times the current font size. Which of the following units should he use?
a. em
b. mm
c. px
d. ex
ANS:
A
4. Ben wants to take advantage of the shorthand property to shorten the code that specifies the padding.
Which of the following property statements specifies a top and bottom padding of 0.1 cm and a left
and right padding of 0.5 cm?
a. padding: 0.1cm 0.1cm 0.5cm 0.5cm;
b. padding: 0.1cm 0.5cm 0.1cm;
c. padding: 0.5cm 0.1cm;
d. padding: 0.5cm 0.1cm 0.5cm;
ANS:
B