oDesk CSS 2.0 Test answer

oDesk CSS 2.0 Test answer

You defined some links as follows:

a:link {color: green}
a:visited {color: blue}
a:hover {color: red}
a:active {color: black}
What will be the color, when the mouse goes over a link?
a. Green
b. Blue
c. Red
d. Black
Which style property can be used to display only some part of an image?
a. snap
b. clip
c. scroll
d. visible
How will you display text as a superscript?
a. vertical-align: super
b. vertical-align: superscript
c. vertical-align: top
While displaying some text on a web page you want to increase the spacing between the words and bring the letters within the word closer to each other. Which of the following is the best style definition if you are targeting all the paragraphs?
a. par {letter-spacing: 3px; word-spacing: -5px}
b. par{letter-spacing: -0.8px; word-spacing: 25px}
c. p {l-spacing: 3px; w-spacing: -5px}
d. p {letter-spacing: -0.8px; word-spacing: 25px}
Here is one of the styles defined in your webpage:

.redborder
{
border-color:#ff0000;
border-width:thin thick
}

What type of border will be displayed if one of the paragraphs defined in the webpage uses this style?
a. This will display a red border with thin top and bottom
b. This will display a red border with thick top and bottom
c. This will display a red border with thick left and right
d. This will not display any border
Which of the following font properties deals with aspect value?
a. font-weight
b. font-variant
c. font-size-adjust
d. font-size
Background-position sets the position of the background image. What happens if its value is 0%0%?
a. Image will have zero width and height so it will be hidden.
b. Image will be positioned at the upper left corner.
c. Image will be positioned at the lower right corner
d. None of the above
The following is a style definition:

td#aln
{ text-align: center;
color: blue }

How will you refer to this style in your web page?
a. By using the class attribute on a td cell
b. By using the id attribute on a td cell
c. By using the class attribute on any HTML element which supports the class attribute
d. By using the id attribute on any HTML element which supports the id attribute
Which of the following are correct values of the overflow property?
a. visible
b. hidden
c. scroll
d. auto
Is it possible to force a style definition in a linked stylesheet to over-ride an in-line style definition?
a. Yes
b. No
Which of the following statement is correct?
a. When using CSS, positioning can be absolute, relative or dynamic
b. The float property for text/images can be left, right or center
c. The values for visibility can be true or false
d. The display property sets how an element is displayed
Which of the following is correct?
a. blockquote { text-padding: 2em 4em 5em }
b. blockquote { padding-x: 2em 4em 5em }
c. blockquote { padding-y: 2em 4em 5em }
d. blockquote { padding: 2em 4em 5em }
Which of the following is not a correct keyword value for the display property?
a. expanded
b. inline-table
c. table-row
d. table-column-group
Which of the following cursor types is not valid?
a. wait
b. pointer
c. text
d. image
The following is a style definition:

#styl2
{
color: red;
}

How will you refer to this style in your web page?
a. By using the class attribute in a td cell
b. By using the class attribute in any HTML element which supports the class attribute
c. By using the id attribute in any HTML element which supports the 'id' attribute
When would you prefer to use the @import technique for applying a style sheet to your web page?
a. When you are creating pages for older versions of Netscape Navigator
b. When you don't want older browsers like IE4 or Netscape 4 to use the style sheet
c. When you want to include a css file in another css file
d. There is no such technique available for applying style sheets
Which of the following is not a valid list property?
a. list-style-type
b. list-style-position
c. list-style-image
d. list-style-align
You have the following style definition:

h2, h4, h5, h6
{
color: cyan;
}

Which of the following is correct for the above definition?
a. Grouping of tags is not allowed in the style definition
b. The style definition should span a single line
c. Grouping tags should be separated by semicolons
d. You can group as many tags as you like
Can you define multiple styles for the same HTML element/tag or selector?
a. Yes
b. No
What is the effect of the following style:

p strong {color: green; }
a. All strong text and all paragraph text will be displayed in green color
b. All paragraphs that are contained within <strong></strong> tags will be displayed in green color
c. All strong text that is contained in a paragraph will be displayed in green color
d. Only the paragraph text will be displayed in green color
e. Only the strong text will be displayed in green color
f. The style definition is erroneous and will not be applied to any element of the webpage
The default value for the overflow property is:
a. scroll
b. visible
c. hidden
d. auto
Which of the following is true for a class selector?
a. It uses a hash as the separator symbol
b. It applies the style to only the first element defined with that style
c. It applies the style to only the last element defined with that style
d. It applies the style to all the elements defined with that style
which of the following properties specifies the minimum number of lines of a paragraph that must be left at the bottom of a page?
a. orphans
b. widows
c. bottom
d. overflow
e. None of the above
The font "Times New Roman" has an aspect value of 0.46. What do you understand from this?
a. When font size is set to 46pt, the height of the letter 'x' will be 100pt
b. When font size is set to 100pt, the height of the letter 'x' will be 46pt
You want to define the same media style for both print and screen media. Which of the following is the correct structure for the style?
a. @media screen, print {  span.med{font-weight:bold}  }
b. .media screen, print {  span.med{font-weight:bold}  }
c. .media screen print {  span.med{font-weight:bold}  }
d. #media screen, print {  span.med{font-weight:bold}  }
Which of the following values are correct for font-style?
a. normal, wider, narrower
b. normal, italic, oblique
c. normal, bold, lighter
d. small, medium, large
Which of the following is not a pseudo class?
a. link
b. active
c. lang
d. ins
You defined two styles as follows:

td.right {text-align: right}
td.left {text-align: left}

Which of the following is the right way to use them in an HTML page?
a. <td class="td.right">Some Text</td>
b. <td class="right" class="left">Some Text</td>
c. <td class="td.left" class="td.right">Some Text</td>
d. <td class="right">Some Text</td>
The following is a style definition:

BODY {background: url('banner.jpeg') right top}

What is the percentage of the background-position?
a. 0% 0%
b. 0% 100%
c. 100% 0%
d. 100% 100%
Consider this style definition:

p,i { color:red }

What do you understand about the contextual selector used above?
a. All the text within a paragraph will be italicized
b. All the italic text in the page will have red color
c. All the page text under <p></p> tag and <i></i> tag will be red
d. All the italic text within a paragraph will be red
You have to display an image behind an absolutely positioned paragraph text. Which of the following will you use?
a. Set negative z-index for the image
b. Set positive z-index for the image
c. Set negative x-index for the image
d. Set positive x-index for the image
Which style will always be over-ridden if you are using style definitions in the <head> tag, linked stylesheets using the <link..> tag and imported stylesheets using the @import method, provided same the style is defined using each of these techniques.
a. The in-line style
b. The style definition in the tag
c. The linked stylesheet
d. The imported stylesheet @import
Which of the following is not a valid page break?
a. page-break-inside
b. page-break-outside
c. page-break-before
d. page-break-after
Read the following statements:

@page rotated {size: landscape}
TABLE {page: rotated; page-break-before: right}

What does this code do?
a. It will put all tables on a right-hand side landscape page
b. It will rotate the page if the table is positioned at the right side
c. It will keep the table in landscape position and rotate the page
d. None of the above
Which of the following is not a valid property of an aural style sheet?
a. cue
b. voice-family
c. loud
d. speak
e. All of the above are valid.
Which element property is required to define internal styles?
a. class
b. style
c. span
d. link
When are you likely to use an id selector in your stylesheet?
a. When you want to apply the style to elements that appear repeatedly on a page
b. When you want to apply the style to only one element per page
c. The id selector is just like the class selector
d. It is better to use the class selector instead
How will you link a style sheet named "ssa.css" in your web page?
a. <import name=''stylesheet'' url=''ssa.css''>
b. <link rel=''stylesheet'' type=''text/css'' href="ssa.css">
c. <style name=''stylesheet'' url=''ssa.css''>
Your webpage contains several unordered lists:
Item A
Item B
Item C
Item D
Item E
Item F
Item G
The style sheet for these lists is:

ul {list-style-type: disc}

Due to some reason, you now want all the unordered list items to be numbered. What minimum change in your CSS/HTML will do this?
a. Replace all ul with ol in the HTML page
b. Set list-style-type:number in the CSS
c. Set list-style-type:decimal in the CSS
d. Set list-style-type:integer in the CSS
You are designing a web site and need to set the background image for all the web pages. You want a small background image to repeat and fill up the whole background. Which of the following body styles is ideal for this?
a. body{ background: url(/images/bg.gif);
repeat: repeat-x }
b. body{ background: url(/images/bg.gif);
repeat: repeat-y }
c. body{ background-image: url(/images/bg.gif);
background -repeat: no-repeat }
d. body { background-image: url(images/bg.gif);background-repeat: repeat}
You have defined a p tag style as follows:

p
{
color: #ff0000;
font-variant: small-caps
}

You want the above style to work only on the first line of the paragraph. What modification will you make to the style definition?
a. p:first-only
b. p:first-line
c. p.first-line
d. p:first
Read the following statements:

Statement 1:Vertical margins between a floated box and any other box do not collapse.
Statement 2:Margins of absolutely and relatively positioned boxes collapse.

Which of the following is correct?
a. Statement 1 is correct but statement 2 is incorrect
b. Statement 2 is correct but statement 1 is incorrect
c. Both statements are correct
d. Both statements are incorrect
You have an article of 100 lines. If for instance, you want to describe the theme with a few lines inside the text highlighted separately as shown in the image, which of the following properties will you use?


a. Outline
b. display
c. float
d. merge
Read the following code:

BODY {
background: white url("bar.gif");
background-repeat: repeat-y;
background-position: center;
}

What will be the output of this code?
a. Image bar.gif will be tiled vertically in the background in the center of the page.
b. Image bar.gif will be tiled horizontally in the background in the center of the page
c. Image bar.gif will be displayed in the center of the page
d. Image bar.gif will be stretched in the center of the page
Consider the following font definition:

font-weight: bold

What is the other way of getting the same result?
a. font-weight:b
b. font-weight:bolder
c. font-weight:bld
d. font-weight:700
You want to display a list of items on your webpage using the <li> tag instead of bullets. You want each list element to be marked by a small graphic that you have created. Which style could you use?
a. list-style
b. list-style-marker
c. list-marker
d. list-style-graphic
e. list-bullet
f. list-style-image
Which of the following attributes can be used to supersede any of the contradictory styles with equal weight?
a. !supersede
b. !high
c. !important
d. !key
You developed a website using HTML and style sheets. You defined a style for the H4 tag within the head tag, in the imported style sheet and in-line. Which style definition will be used when the page is seen in a browser?
a. Default browser H4 definition
b. External style sheet definition
c. Inline style definition
d. Style definition in the head tag
Which of the following border styles is not correct?
a. border-style : ridge
b. border-style : outset
c. border-style : dotted
d. border-style : matted
You want to increase the space between the lines in all your paragraphs. What will you use?
a. p{ width:1cm}
b. p{ height: 1cm}
c. p{ line-height: 1cm}
d. p{ line-width: 1cm}
You are fetching customer names from a database. The names in the database are mostly in lowercase. What is the name of the text property which will facilitate capitalization of these names?
a. text-mode
b. text-transform
c. text-decoration
d. text-shadow
e. text-case
You defined two styles as follows:

td.right {text-align: right}
td.left {text-align: left}

Which of the following is the right way to use them in an HTML page?
a. <td class="td.right">Some Text</td>
b. <td class="right" class="left">Some Text</td>
c. <td class="td.left" class="td.right">Some Text</td>
d. <td class="right">Some Text</td>
Paged media differ from continuous media in that the content of the document is divided into one or more pages. When you set the dimensions, which of the following will be applied?
a. The dimensions of the page area are the dimensions of the page box minus the margin area.
b. The dimensions of the page area are the dimensions of the page box plus the margin area.
c. The dimensions of the page area are the dimensions of the page box and margin area does not affect it.
d. None of the above
Which of the following is correct with regard to comments in a style sheet?
a. Comments can appear outside the style definition only
b. Comments start with //
c. Comments end with */
d. Comments are not permitted in a style sheet
What is the effect of the following style:

p strong {color: green; }
a. All strong text and all paragraph text will be displayed in green color
b. All paragraphs that are contained within <strong></strong> tags will be displayed in green color
c. All strong text that is contained in a paragraph will be displayed in green color
d. Only the paragraph text will be displayed in green color
e. Only the strong text will be displayed in green color
f. The style definition is erroneous and will not be applied to any element of the webpage
Which of the following does not apply to external styles?
a. Clean Separation of Design & Content
b. Minimal Code Duplication
c. Highest priority
d. Reduces page download time
How will you link a style sheet named "ssa.css" in your web page?
a. <import name=''stylesheet'' url=''ssa.css''>
b. <link rel=''stylesheet'' type=''text/css'' href="ssa.css">
c. <style name=''stylesheet'' url=''ssa.css''>
You want to display a table whose cell borders are as per the following rules:

1. Left Border should be double
2. Right Border should be dashed
3. Top Border should be dotted
4. Bottom Border should be solid

Choose the correct style definition:
a. border-style:double dotted dashed solid
b. border-style:dotted dashed solid double
c. border-style:dashed double solid dotted
d. border-style:solid double dotted dashed
You defined a style to left align the text:

.left {text-align: left}

Select the correct statement:
a. The style can be applied to any element in the HTML page
b. The style can be applied using the ID attribute
c. The style can be applied using the class attribute
d. The style is incomplete without a prefixed element tag name
The following is a sample style:

1. p
2. (
3. font-family:arial
4. color:black
5. text-align:left
6. );

What correction is required in the above style?
a. The style definition should be enclosed in curly braces
b. Multiple items within a style should be separated by ";"
c. The style should not close with a semicolon
d. p should be followed by an equal-to sign
The font-family property is used to specify a:
a. family name
b. generic family
c. family name and/or generic family
You want to define the same media style for both print and screen media. Which of the following is the correct structure for the style?
a. @media screen, print {  span.med{font-weight:bold}  }
b. .media screen, print {  span.med{font-weight:bold}  }
c. .media screen print {  span.med{font-weight:bold}  }
d. #media screen, print {  span.med{font-weight:bold}  }
Consider this style definition:

p,i { color:red }

What do you understand about the contextual selector used above?
a. All the text within a paragraph will be italicized
b. All the italic text in the page will have red color
c. All the page text under <p></p> tag and <i></i> tag will be red
d. All the italic text within a paragraph will be red
Which of the following are valid css text properties in CSS2.0?
a. direction
b. text-transform
c. text-indent
d. text-height
Which of the following is not a valid text-decoration option?
a. text-decoration:line-through
b. text-decoration:in-line
c. text-decoration:overline
d. text-decoration:underline
e. text-decoration:none
Which style will always be over-ridden if you are using style definitions in the tag, linked stylesheets using the tag and imported stylesheets using the @import method, provided the same style is defined using each of these techniques.
a. The in-line style
b. The style definition in the tag
c. The linked stylesheet
d. The imported stylesheet @import
You want to display a list of items on your webpage using the <li> tag, instead of bullets. You want each list element to be marked by roman numbering, Which style will you use?
a. list-style
b. list-style-type
c. list-marker
d. list-style-marker
e. list-bullet
f. list-style-bullet
Which of the following options regarding page media groups is wrong?
a. continuous/paged
b. visual/audio/speech/tactile
c. grid/bitmap
d. dynamic/interactive/static
Which of the following is true for an ID selector?
a. It uses a dot as the separator symbol
b. It applies the style to only the first element defined with that selector
c. It applies the style to only the last element defined with that selector
d. It applies the style to all the elements defined with that selector
Which of the following is not true for a style sheet?
a. A style sheet defines how an HTML element will be displayed
b. Internal and external style sheets cannot be used together
c. Multiple style definitions will cascade into one
d. The same style sheet can be used by many HTML pages
You are designing a web site and need to set the background image for all the web pages. You want a small background image to repeat and fill up the whole background. Which of the following body styles is ideal for this?
a. body{ background: url(/images/bg.gif);
repeat: repeat-x }
b. body{ background: url(/images/bg.gif);
repeat: repeat-y }
c. body{ background-image: url(/images/bg.gif);
background -repeat: no-repeat }
d. body { background-image: url(images/bg.gif);background-repeat: repeat}
Which of the following does not apply to external styles?
a. Clean Separation of Design & Content
b. Minimal Code Duplication
c. Highest priority
d. Reduces page download time

0 comments: