Name: 
 

Skills Practice - HTML/XHTML - Tutorial 7



True/False
Indicate whether the statement is true or false.
 

 1. 

HTML and XHTML were primarily intended for Web page design.
 

 2. 

Browser support for HTML is uneven.
 

 3. 

You may use a combination of all three approaches to employing CSS in your Web pages.
 

 4. 

An external style sheet overrides any inline style.
 

 5. 

An embedded style overrides an external style sheet.
 

 6. 

The internal style rules set by the Web browser override any external style sheet.
 

 7. 

You could set all boldfaced text to blue using the style definition: b {color: blue}.
 

 8. 

Not all browsers support contextual selectors.
 

 9. 

A user’s operating system does not impact the appearance of a document.
 

 10. 

An inline style applies only to the specific element that it modifies.
 

 11. 

The media attribute is required, regardless of the expected output device.
 

 12. 

Using the link element, you can link a single style sheet to multiple documents in your Web site.
 

 13. 

You cannot link a single document to more than one style sheet.
 

 14. 

The ability to view your page’s content depends on the ability to access your style sheet.
 

 15. 

You should make sure that your Web pages are still readable even when your style sheets are not adopted by the user.
 

 16. 

The descendant element has to be a direct child of the parent element.
 

 17. 

XHTML and HTML require that each id be unique, so a particular id value can be used only once in a document.
 

 18. 

By default, the height of an element is determined by its content.
 

 19. 

Two or more pseudo-classes can never apply to the same element.
 

 20. 

HTML and XHTML support attributes to create hover effects.
 

 21. 

More often used than absolute positioning is static positioning.
 

 22. 

By default, elements that are formatted later in an HTML or XHTML document are stacked on top of earlier elements.
 

 23. 

A style sheet in which the output device is not specified is applied to all devices, unless it is superceded by a style designed for a particular device.
 

 24. 

All output media can be described based on some common properties.
 

 25. 

The disadvantage of creating printer-friendly versions of documents across different media is that it forces you to create and maintain duplicate copies of your pages.
 

 26. 

A computer screen is paged, visual, bitmap, and static.
 

 27. 

A printout is continuous, visual, bitmap, and interactive or static.
 

 28. 

Setting the display style to “none” hides an element but does not remove it from the page flow.
 

 29. 

With the page-break-before style, the “avoid” value will cause a page break to never be placed at a given point in the document.
 

Modified True/False
Indicate whether the statement is true or false. If false, change the identified word or phrase to make the statement true.
 

 30. 

Unless you have a compelling reason to use @import, you are probably better off using the <link> tag. _________________________

 

 31. 

A pseudo-class is a classification of an element based on its content, use, or position. _________________________

 

 32. 

An inline style sheet is a simple text file that contains style declarations. _________________________

 

 33. 

The !priority property is useful in situations where you want to ensure that a particular style is always enforced no matter what its location in the order of precedence. _________________________

 
 
nar001-1.jpg
 

 34. 

The item marked 1 in the figure above is the margin. _________________________

 

 35. 

The item marked 3 in the figure above is the padding. _________________________

 

 36. 

The item marked 2 in the figure above is the border. _________________________

 

 37. 

A pseudo-form is a classification of an element based on its status, position, or current use in the document. _________________________

 

 38. 

Colors must be entered either as a supported color name or as a decimal color value. _________________________

 
 
nar002-1.jpg
 

 39. 

The item marked 2 in the figure above represents the hidden value of the overflow property. _________________________

 

 40. 

The item marked 3 in the figure above represents the auto value of the overflow property. _________________________

 

 41. 

The item marked 4 in the figure above represents the scroll value of the overflow property. _________________________

 

 42. 

The clip style allows you to define a rectangular region through which the element’s content can be viewed. _________________________

 

 43. 

A value of auto for the stacking style allows the browser to determine stacking order using the default rules. _________________________

 

 44. 

The z-index style only works for elements that are placed with relative positioning. __________________________

 

 45. 

The media attribute can contain a period-separated list of media types. _________________________

 

 46. 

The @screen rule allows you to place media types in a comma-separated list. _________________________

 

 47. 

A display value of inherit is used with tables to prevent a row or column from being displayed. _________________________

 

 48. 

A display value of collapse causes an element to share the visibility style of its parent. _________________________

 

Multiple Choice
Identify the choice that best completes the statement or answers the question.
 

 49. 

The first CSS standard was released in ____.
a.
1996
c.
1999
b.
1997
d.
2001
 

 50. 

The second CSS standard was released in ____.
a.
1996
c.
1998
b.
1997
d.
2001
 

 51. 

The main style sheet standard is ____.
a.
XML
c.
HTML
b.
DDL
d.
CSS
 

 52. 

The specifications for CSS are maintained by ____.
a.
DARPA
c.
NSF
b.
the W3C
d.
ARPA
 

 53. 

____ was introduced by the W3C in 2002.
a.
CSS1
c.
CSS2.1
b.
CSS2
d.
CSS3
 

 54. 

____ types are a system for indicating document formats.
a.
CSS
c.
MIME
b.
FTP
d.
XML
 

 55. 

For CSS, the MIME type is “____”.
a.
div/css
c.
media/css
b.
url/css
d.
text/css
 

 56. 

The extension for CSS style sheets is ____.
a.
.csl
c.
.xcs
b.
.cs2
d.
.css
 

 57. 

You can override precedence rules by adding the ____ property to a style declaration.
a.
!override
c.
!important
b.
!main
d.
!priority
 

 58. 

To override style ____ you specify an alternate style for one of the descendant elements of the parent.
a.
recurrence
c.
dependence
b.
inheritance
d.
transition
 

 59. 

In the style li b {color: blue}, li is the ____ element.
a.
child
c.
ascendant
b.
parent
d.
descendent
 

 60. 

In the style li b {color: blue}, b is the ____ element.
a.
parent
c.
descendent
b.
main
d.
base
 

 61. 

The ____ selector is used to match any element in the hierarchy.
a.
$
c.
@
b.
#
d.
*
 

 62. 

Which of the following is part of CSS3?
a.
[att]
c.
[att~=“val”]
b.
[att=“val”]
d.
[att$=“val”]
 

 63. 

The ____ selector matches elements containing the att attribute.
a.
[att]
c.
[att~=“val”]
b.
[att=“val”]
d.
[att|=“val”]
 

 64. 

The ____ selector matches elements whose att attribute equals val.
a.
[att]
c.
[att~=“val”]
b.
[att=“val”]
d.
[att|=“val”]
 

 65. 

The ____ selector matches elements whose att attribute value is a space-separated list of words, one of which matches val exactly.
a.
[att]
c.
[att~=“val”]
b.
[att=“val”]
d.
[att|=“val”]
 

 66. 

The ____ selector matches elements whose att attribute value is a hyphen-separated list of words beginning with val.
a.
[att]
c.
[att~=“val”]
b.
[att=“val”]
d.
[att|=“val”]
 

 67. 

The ____ selector matches elements whose att attribute begins with val.
a.
[att]
c.
[att$=“val”]
b.
[att^=“val”]
d.
[att*=“val”]
 

 68. 

The ____ selector matches elements whose att attribute ends with val.
a.
[att]
c.
[att$=“val”]
b.
[att^=“val”]
d.
[att*=“val”]
 

 69. 

The ____ selector matches elements whose att attribute contains the value val.
a.
[att]
c.
[att$=“val”]
b.
[att^=“val”]
d.
[att*=“val”]
 

 70. 

You can mark a group of elements with a common identifier using the ____ attribute.
a.
id
c.
name
b.
class
d.
value
 

 71. 

HTML and XHTML support a generic block-level element called the ____ element.
a.
main
c.
div
b.
id
d.
class
 

 72. 

The ____ element is used as a general block-level element.
a.
span
c.
class
b.
id
d.
div
 

 73. 

The ____ value of the display style tells the browser not the display the element.
a.
null
c.
empty
b.
none
d.
hide
 

 74. 

The ____ value of the display style tells the browser to display the element as either an inline or block-level element, depending on the context.
a.
list-item
c.
block
b.
inline
d.
run-in
 

 75. 

Which of the following values of the display style are newly supported by CSS2?
a.
table
c.
inherit
b.
block
d.
none
 

 76. 

Which of the following values of the display style are supported by CSS?
a.
table-row
c.
inline-block
b.
table-cell
d.
table-row-group
 
 
nar003-1.jpg
 

 77. 

The item indicated in the figure above is the ____ value.
a.
class
c.
name
b.
id
d.
null
 

 78. 

You can use the value ____ to allow each browser to set the padding size.
a.
auto
c.
void
b.
self
d.
null
 
 
nar004-1.jpg
 

 79. 

Which of the border style types in the figure above is the solid style?
a.
1
c.
3
b.
2
d.
4
 

 80. 

Which of the border style types in the figure above is the dashed style?
a.
1
c.
3
b.
2
d.
4
 

 81. 

Which of the border style types in the figure above is the dotted style?
a.
1
c.
3
b.
2
d.
4
 

 82. 

Which of the border style types in the figure above is the double style?
a.
1
c.
3
b.
2
d.
4
 

 83. 

Which of the border style types in the figure above is the outset style?
a.
5
c.
7
b.
6
d.
8
 

 84. 

Which of the border style types in the figure above is the inset style?
a.
5
c.
7
b.
6
d.
8
 

 85. 

Which of the border style types in the figure above is the groove style?
a.
6
c.
8
b.
7
d.
9
 

 86. 

Which of the border style types in the figure above is the ridge style?
a.
6
c.
8
b.
7
d.
9
 

 87. 

What is the name of the border style marked 9 in the figure above?
a.
empty
c.
void
b.
null
d.
none
 

 88. 

The default position is ____.
a.
absolute
c.
static
b.
relative
d.
fixed
 

 89. 

____ positioning allows browsers to place an element based on where it flows in the document.
a.
Absolute
c.
Static
b.
Relative
d.
Fixed
 

 90. 

____ positioning is essentially the same as not using any CSS positioning at all.
a.
Static
c.
Absolute
b.
Relative
d.
Fixed
 

 91. 

____ positioning enables you to place an element at specific coordinates either on a page or within a containing element.
a.
Fixed
c.
Inherit
b.
Absolute
d.
Static
 

 92. 

____ positioning takes an element out of the normal flow of a document, and any subsequent content flows into the space previously occupied by the element.
a.
Fixed
c.
Static
b.
Absolute
d.
Inherit
 

 93. 

With the overflow property, ____ is the default value.
a.
visible
c.
scroll
b.
hidden
d.
auto
 

 94. 

With the overflow property, a value of ____ instructs browsers to increase the height of an element to fit the overflow content.
a.
hidden
c.
visible
b.
scroll
d.
auto
 

 95. 

With the overflow property, the ____ value keeps an element at the specified height and width, but cuts off the overflow.
a.
scroll
c.
auto
b.
hidden
d.
visible
 

 96. 

With the overflow property, the ____ value keeps an element at the specified dimensions but adds horizontal and vertical scrollbars to allow users to scroll through the overflow.
a.
visible
c.
scroll
b.
hidden
d.
auto
 

 97. 

With the overflow property, the ____ value keeps an element at the specified size, but adds scrollbars only if they are needed.
a.
hidden
c.
scroll
b.
visible
d.
auto
 
 
nar002-1.jpg
 

 98. 

The item marked ____ in the figure above represents the visible value of the overflow property.
a.
1
c.
3
b.
2
d.
4
 

Completion
Complete each statement.
 

 99. 

A(n)  _________________ sheet is a file or form that describes the layout and appearance of a document.
 

 

 100. 

The most commonly used style sheet language on the Web is the ______________________________ language.
 

 

 101. 

____________________ styles are applied to a specific element through the use of the style attribute in the element’s tag.
 

 

 102. 

With ____________________ styles, a style sheet is placed in a document’s head, setting the style definitions for the document’s elements.
 

 

 103. 

With ____________________ styles, a style sheet is saved in a separate document and is applied to a group of pages in a Web site.
 

 

 104. 

The effect known as style ____________________ causes style declarations to cascade down through a document’s hierarchy.
 

 

 105. 

Contextual _________________ give you a way of applying a style based on the context in which an element is used.
 

 

 106. 

____________________ widths are expressed in standard CSS units of length, or with the keywords, “thin,” “medium,” or “thick.”
 

 

 107. 

A(n) ____________________ effect is applied only when a user rolls the mouse pointer over an element.
 

 

 108. 

The ____________________ style has five possible values: static, relative, absolute, fixed, and inherit.
 

 

 109. 

____________________ positioning is used to move an element relative to its default position on the page.
 

 

 110. 

CSS2 uses the concept of media ____________________ to describe basic facets of the output for different media, and to differentiate between different types of media based on the ways they render content.
 

 

 111. 

CSS2 defines printed pages by extending the box model to incorporate the entire page in a(n) ____________________.
 

 

 112. 

If you do not specify the orientation, browsers assume a(n) ____________________ orientation.
 

 

 113. 

When setting page size, you can replace the width, height, and orientation values with the keyword ____________________ to let the browser determine the page dimensions.
 

 

 114. 

CSS supports ____________________ styles that determine where page breaks should be placed in relation to the elements in a page.
 

 

 115. 

A(n) ____________________ refers to the final few lines of an element’s text when they appear at the top of a page, while most of the element’s text appears on the previous page.
 

 

 116. 

The term ____________________ describes the first few lines of an element’s text when they appear at the bottom of a page, with the bulk of the element’s text appearing on the next page.
 

 

 117. 

To apply a page break inside an element, use the style page-break-inside: type, where type is auto, ____________________, or avoid.
 

 

Matching
 
 
Identify the letter of the choice that best matches the phrase or definition.
a.
div
e.
absolute
b.
border
f.
relative
c.
pseudo-class
g.
fixed
d.
static
h.
inherit
 

 118. 

The default positioning style
 

 119. 

Its widths are expressed with the keywords thin, medium, and thick
 

 120. 

Positioning used to assign an element the position style of its parent element
 

 121. 

Classification of an element based on its status, position, or current use in the document
 

 122. 

Positioning used to put an element at a specific spot in the document window while the rest of the page scrolls by
 

 123. 

Positioning that enables you to place an element at specific coordinates
 

 124. 

Used the same way as the span element is used as a general inline element
 

 125. 

Positioning used to move an element relative to its default position on the page
 

Short Answer
 

 126. 

What is the syntax for using the @import command with your styles?
 

 127. 

Why have Web designers advocated style sheets for HTML and XHTML?
 

 128. 

CSS2 expanded the language to support styles for what?
 

 129. 

What is the syntax for applying an inline style to an element?
 

 130. 

What happens if you do not specify a value for the media attribute?
 

 131. 

Show how you can replace a set of repetitive declarations, such as

h1 {font-family: sans-serif}
h2 {font-family: sans-serif}
h3 {font-family: sans-serif}

with a single declaration.
 

 132. 

How do you select an element based on the element’s attributes?
 

 133. 

What is the syntax of the class selector?
 

 134. 

What is the syntax of the class attribute?
 

 135. 

Why do Web designers advocate the use of style sheets over tables?
 

 136. 

What is a drawback to the use of style sheets for layout?
 

 137. 

What is the syntax of the div element?
 

 138. 

What happens if you include only three values for the padding style?
 

 139. 

What happens if you include only two values for the padding style?
 

 140. 

What happens if you only specify one value for the padding style?
 

 141. 

How do you define the padding size for individual sides of an element?
 

 142. 

What is the style declaration to place a red 2-pixel-wide double border around an element?
 

 143. 

What is the syntax of the position style?
 

 144. 

With static positioning, what happens to any values specified for the top or left styles?
 

 145. 

What is the syntax of the clip style?
 

Essay
 

 146. 

What are the four factors that determine how an HTML or XHTML document is rendered for an end user?
 

 147. 

Briefly describe each of the three ways of applying a style to an HTML or XHTML document.
 

 148. 

You want all of the links in a document to display by default without underlining. If the mouse pointer is hovering over a link, you want the link text to appear in a black font and underlined. What are the style declarations to create this rollover effect? Is the order of these declarations important, and if so, why?
 

 149. 

Categorize the following output media based on the four media groups: aural; braille; embossed; handheld; print; tty; and tv.
 

 150. 

Browsers attempt to use page breaks that obey a series of guidelines. What are those guidelines?
 



 
Check Your Work     Start Over