CSS 2 question and answer for oDesk and Elance

Question 1: Which of the following rules is equivalent to the em { color: rgb(255,0,0) } style?

a.em { color: rgb(300,0,0) }

b.em { color: rgb(255,-10,0) }

c.em { color: rgb(110%, 0%, 0%) }

d.em { color: rgb(100%, 0%, 0%) }

e.All of the above (Answer)

 

Question 2: Which of the following are not valid values for the target-new property?

a.window

b.tab

c.none

d.parent (Answer)

e.current (Answer)

 

Question 3: What is the type of the letter-spacing property?

a.length

b.number (Answer)

c.percentage

d.integer

 

Question 4:  What will happen if the following style declaration is applied to an element?

p { margin: 3em 2em }

a.The top and the bottom margins will be 3em and the left and the right margins will be 2em.(Answer)

b.The top and the bottom margins will be 2em and the left and the right margins will be 3em.

c.The top and the left margins will be 3em and the bottom and the right margins will be 2em.

d.The top and the right margins will be 2em and the bottom and the left margins will be 3em.

Question 5:  What will happen if the pause property is used as follows?

h2 { pause: 40s 60s }

a. pause-before will be set to 40 seconds and pause-after will be set to 60 seconds. (Answer)

b. pause-after will be set to 40 seconds and pause-before will be set to 60 seconds.

c. pause-after and pause-before will be set to 40 seconds.

d. pause-after and pause-before will be set to 60 seconds.

 

Question 6: Which of the following properties doesn”t take up space?

a. outline (Answer)

b. border

c. Both a and b

 

Question 7:  backface-visibility:hidden; will this property hide the back side when an element is rotated?

a.Yes (Answer)

b.No

Question 8:  What is the initial value of the animation-iteration-count property?

a.0

b.1 (Answer)

c.5

d.None

 

Question 9: If you set the value of the speak property to digits, how would 22 be spoken?

a.twenty two

b.two two (Answer)

c.twenty and two

d.four

 

Question 10: A/An___________ is defined with ‘grid-columns’, ‘grid-rows’ properties

a.Explicit grid (Answer)

b.Natural grid

c.Default grid

d.None of the above

 

Question 11:  The color in three digit RGB notation is #fb0. What will be its equivalent six digit color code?

a.#fb0fb0

b.#ffbb00 (Answer)

c.#fbfb00

d.None of the above

 

Question 12:  Which of the following is the initial value for the column-fill property?

a.auto

b.balance (Answer)

c.none

 

Question 13: What will be the output of the following rule?

em { color: rgba(0,0,255,1) }

a.Opacity 1 with solid red color

b.Opacity 0 with solid blue color

c.Opacity 0 with solid red color

d.Opacity 1 with solid blue color. (Answer)

e.None of the above

 

Question 14: Which of the given options is/are equivalent to the following rule?

DIV { line-height: 1.2; font-size: 10pt }

a.DIV { line-height: 1.2em; font-size: 10pt } (Answer)

b.DIV { line-height: 12em; font-size: 10pt }

c.DIV { line-height: 120%; font-size: 10pt } (Answer)

d.DIV { line-height: 20%; font-size: 10pt }

e.DIV { line-height: 80%; font-size: 10pt }

 

Question 15: What will happen if the value of the transform-style property is set to flat and the element has children?

a.The element will be shown with 3D effect but the children will be rendered flattened into the 2D plane.

b.The element will be shown with 2D effect but the children will be rendered into the 3D plane.

c.Both the element and its children elements will be rendered in 3D effect.

d.Both the element and its children elements will be rendered in 2D effect. (Answer)

 

Question 16: Which of the following is not a user interface element fragment selector?

a.value

b.choices

c.default. (Answer)

d.repeat-item

e.repeat-index

 

Question 17: Which of the following value of the white-space property will set the value of white-space-collapse to “preserve” and value of the text-wrap to “none”?

a.normal

b.pre

c.nowrap (Answer)

d.pre-wrap

e.pre-line

 

Question 18: What is the maximum value that can be given to the voice-volume property?

a.0

b.10

c.100 (Answer)

d.500

e.None of the above

 

Question 19: If you are using the white-space-collapse property with value collapse, what will be the output of the following string?

John leads his team to the victory, but fails to reach the finals

a.Johnleadshisteamtothevictory,butfailstoreachthefinals.

b.John leads his team to the victory, but fails to reach the finals. (Answer)

c.John leads his team to the victory, but fails to reach the finals.

d.John leads his team to thevictory, but fails to reach thefinals.

 

 

Question 20: Which of the following declarations can be used to cover the whole background?

a.body

{

background: red url(“test.gif”);

background-repeat: repeat-y;

background-attachment: fixed;

}

b.body

{

background: red url(“test.gif”);

background-repeat: repeat-x;

background-attachment: fixed;

}

c.body

{

background: red url(“test.gif”);

background-repeat: no-repeat;

background-attachment: fixed;

}

d.body{

background: red url(“test.gif”);

background-repeat: repeat;

background-attachment: fixed;

(Answer)

e.body

{

background-image: url(“test.gif”);

background-repeat: space;

}

 

Question 21:

Which of the following properties allow percentages in their value fields?

a.font-size (Answer)

b.font-variant

c.font-weight

d.line-height (Answer)

 

Question 22: To which of the following elements can the min-width property not be applied?

a.button

b.span (Answer)

c.table row

 

Question 23: Consider the following code and say what will happen if you click on More?

@media print

{

.footnote

{

float: footnote;

content: target-move(attr(href, url)) }

.marker { display: none }

}

 

HTML code:

<p>John was a great writer<a class=”footnote” href=”#words”> [More]</a>.

<p id=words><span class=”marker”>[More]</span> Great poet too.

a.The tool tip will appear saying Great poet too.

b.A pop up will appear saying Great poet too.

c.The page will shift focus to the line Great poet too.

d.Nothing will happen. (Answer)

 

Question 24: Consider the following code:

<style>

.name::after { content: leader(solid) }

</style>

<div>

<span>Shane Mathew</span>

<span class=”number”>9843423232</span>

</div>

What will be the output if the name and the number end up on different lines?

 

a.Shane Mathew….

…9843423232

b.Shane Mathew____

___9843423232 (Answer)

c.Shane Mathew

9843423232

d.Shane Mathew—

—9843423232

 

Question 25:  What is the default value of the text-align property?

a.start

b.end

c.left (Answer)

d.right

e.center

f.justify

 

Question 26:  What is the problem in the following style sheet?

@import “style.css”;

@media print

{

@import “print-main.css”;

BODY { font-size: 10pt }

}

h1 {color: red }

a.Two style sheets can’t be included with @import.

b.The body tag can’t be included inside @media.

c.@import rule is invalid since it occurs inside a @media block. (Answer)

d.It is valid.

 

Question 27: What is the initial value of the opacity property?

a.0

b.1 (Answer)

c.normal

d.none

Question 28: You want to float an image to the top of the next-page. Which of the following styles will help you to achieve the desired result?

a.img { float: next-page; }

b.img { float: top-corner next-page; }

c.img { float: next-page top; }

d.b and c (Answer)

 

Question 29: Consider the following code:

body { text-replace: “a” “b” “b” “c” }

What will be the output of the following string if you implement the text-replace style?

andy lives behind cafe

a.bndy lives behind cbfe

b.cndy lives cehind ccfe

c.andy lives behind café (Answer)

d.andy lives cehind bafe

 

Question 30: Which of the following is not a valid page break?

a.page-break-inside

b.page-break-outside (Answer)

c.page-break-before

d.page-break-after

e.None of the above

 

Question 31: For the clear property, which of the following value is not valid?

a.none

b.left

c.right

d.top (Answer)

 

Question 32: What will happen if the cursor property value is set to none?

a.The default cursor will be displayed. (Answer)

b.No cursor will be displayed.

c.A pointer cursor will be displayed.

d.A text cursor will be displayed.

 

Question 33: State whether following statement is true or false.

The RGB color model is hardware-specific while the HSL is symmetrical to lightness and darkness.

a.True (Answer)

b.False

 

Question 34: Which of the following is not a valid value for the font-stretch property?

a.condensed

b.normal

c.semi-narrower (Answer)

d.expanded

e.semi-expanded

 

Question 35: What will happen if the following style declaration is used in the given HTML code?

<style type=”text/css”>

div.container

{

width:38em;

border:1em solid black;

}

div.split

{

box-sizing:border-box;

width:50%;

border:1em silver ridge;

float:left;

}

 

 

HTML code:

<div>

<div>Box 1.</div>

<div>Box 2.</div>

</div>

a.Two boxes will be stacked one on another.

b.Box 1 will be on the left hand side and Box 2 will be on the right hand side horizontally. (Answer)

c.Box 2 will be on the left hand side and Box 1 will be on the right hand side horizontally.

d.Both boxes will overlap each other.

 

Question 36: What will happen if the following declaration is used?

body

{

background-image: url(“test.png”);

background-attachment: fixed;

background-position: 100% 100%;

background-repeat: no-repeat;

}

a.The image will be shown in the background at the bottom left corner.

b.The image will be shown in the background at the bottom right corner. (Answer)

c.The image will be shown in the background at the top left corner.

d.The image will be shown in the background at the top right corner.

e.The image will be shown in the center of the page.

 

Question 37: Consider the following font definition:

font-weight:normal

What is the other way of getting the same result?

a.font-weight:100

b.font-weight:900

c.font-weight:400 (Answer)

d.font-weight:700

 

Question 38: What effect does the following rule have?

div { grid-rows: 4em (0.25em 1em); }

a.It creates rows with 4em height.

b.It creates a header row with 4em height and alternative rows with 0.25em width and 1em heights.

c.It creates a header row with 4em height and alternative rows with 0.25em and 1em heights.(Answer)

d.It creates a header row with 4em width and alternative rows with 0.25em width and 1em heights.

 

Question 39: If the nav-index property of textbox1 is set to 10, that of textbox2 to 5 and that of textbox3 to 8, what will be the navigation order?

a.textbox1, textbox2 ,textbox3

b.textbox2, textbox3 ,textbox1 (Answer)

c.textbox3, textbox2 ,textbox1

d.textbox1, textbox3 ,textbox2

 

Question 40: ruby-text (in XHTML: rt)

Which of the following display values assign ruby semantics to an arbitrary element as given above?

a.It specifies that an element defines a ruby base.

b.It specifies that an element contains one or more ruby bases.

c.It specifies that an element defines a ruby text. (Answer)

d.It specifies that an element contains one or more ruby texts.

e.It specifies that an element defines a ruby structure.

 any html element which support the id attribute

Question 41:Which of the following is true for a classselector?

a.            It usesa hash as the separator symbol

b.            Itapplies the style to only the first element defined with that style

c.            Itapplies the style to only the last element defined with that style

 d.            It applies the style to all the elementsdefined with that style (Answer)

Question 42: Which of the following does not apply to external styles?

a.            Cleanseparation of design & content

b.            Minimalcode duplication

 c.            Highestpriority (Answer)

d.            Reducespage download time

Question 43: 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 inthe background in the center of the page.(Answer)

b.            Imagebar.gif will be tiled horizontally in the background in the center of the page

c.            Imagebar.gif will be displayed in the center of the page

d.            Imagebar.gif will be stretched in the center of the page

 Question 44: Which of the following is not a validtext-decoration option?

a.           Text-decoration :line-through

 b.           Text-decoration :in-line (Answer)

c.            Text-decoration :overline

d.           Text-decoration :underline

e.           Text-decoration :none

 Question 45: 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 (Answer)

c.            Red

d.            Black

Question 46:

 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 in a td cell·

 B. by using the id Attribute in a td cell (Answer)·

C. by using the class attribute in any html element which supports theclass attribute·

D. by using the id attribute in anyhtml element which support the id attribute·

Question 47: Which of the following is not a valid propertyof an aural style sheet?

a.            Cue

b.           Voice-family

 c.            Load  (Answer)

d.            Speak

 Question 48:Your website displays some articles on java programming. Thearticles contain blocks of java code as well. If you want to leave ‘1 cm’ spaceabove and below the code blocks, you would use:

 a.           Code{margin:1cm}

 b.           Code{margin-top:1cm; margin-bottom:1cm}  (Answer)

c.           P{margin:1cm}

d.           P{margin-top:1cm; margin-bottom:1cm}

Question 49: Text text text text

 A      Text text

 Sentence text text

 Inside text text

 A         text ext

 Text     text text

 Text text

 Text text text text

 You have and article of 100 lines. If for instance, you wantto describe the theme with a few lines inside the text highlighted separatelyas show in the image which of the following property will you use?

a.            Outline

b.            Display

c.            Float

d.            Merge

 Question 50: You are fetching customer names from a database. The namesin the database are mostly in lowercase. What is the name of the text propertywhich will facilitate capitalization of these names?

a.            Text-mode

 b.           Text-transform (Answer)

c.           Text-decoration

d.           Text-shadow

e.           Text-case

 

Question: 51: 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 theparagraphs defined in the webpage uses this style?

a.            Thiswill display a red border with thin top and bottom

b.            Thiswill display a red border with thick top and bottom

c.            Thiswill display a red border with thick left and right

d.            Thiswill not display any border

 

Question 52: Which of the following are correct values ofthe overflow property?

a.            Visible

b.            Hidden

c.            Scroll

d.            Auto

Ans: A,B,C,D

Question 53: 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} (Answer)

 Question 54: Which element property is required to defineinternal styles?

a.            Class

b.            Style (Answer)

c.            span

d.            link

Question 55 Which style property can be used to display only some part of an image?

a.            Snap

b.            Clip

c.            Scroll

d.            Visible

 Question 56 Which of the following is not true for a stylesheet?

 a.            A stylesheet defines how an html element will be displayed (Answer)

b.            Internaland external style sheets can not be used together

c.            Multiplestyle definitions will cascade into one

d.            The samestyle sheet can be used by many html pages