Quizes & Games

CSS Quiz

The test contains 20 questions and it's not official, it's just a nice way to see how much you know, or don't know, about CSS.

1.

What is the difference between margins and padding?

padding adds whitespace and margins increase the border size
padding adds whitespace inside the border and margins add whitespace outside
margins add whitespace inside the border and padding adds whitespace outside
there is no difference

2.

 What does "margin-left: auto; margin-right: 0px;" do?

vertically aligns an element to the top of the page
horizontally aligns an element to the center of the page
vertically aligns an element to the bottom of the page
horizontally aligns an element to the right of the page

3.

 How would you set a background image with CSS?

background-url: ;
background: #FFF url();
background-attachment: url();
background-image: src();

4.

 Which of the following examples will set multiple font properties for an entire webpage?

p { font-size: ; }
style="font: ;"
body { font: ; }
body { font-size: ; }

5.

Which of the following is not a valid color code?

rgb(80, 80, 80)
grey
#505050
808080

6.

 What does "text-transform: capitalize;" do?

Does it do this?
Does it do this?
Does it do this?
Does it do this?

7.

 What are floating elements?

elements that are pushed to the right or the left of a page
clear: left;
clouds
elements that are pushed to the top or the bottom of a page

8.

 Can CSS classes and ids both be used (referenced) more than once on the same webpage?

Sorta
Yes
No
None of the above

9.

 Is it possible to make the first character of an element look different than the other characters?

No
Yes
Maybe
None of the above

10.

"a:hover" and "a:active" are both examples of what?

pseudo-classes
ids
selectors
attribute selectors

11.

What is the proper syntax for changing the cursor style?

cursor { type: value; }
mouse-pointer: value;
cursor: value;
mouse-pointer { type: value; }

12.

 From the inside out, which of the following portrays the correct order of a  box model?

content, padding, border, margin
content, margin, border, padding
border, margin, content, padding
margin, border, padding, content

13.

 Which of the following statements is not correct?

ids are identified with a number sign (#)
classes and ids are not used in inline CSS
classes are identified a number sign (#)
classes are identified with a dot (.)

14.

Internal CSS Is:

Maintained In A Separate File
Added Directly to An HTML Tag
Added to An HTML Document's Header
Internal ascept of CSS

15.

What is the proper format of an CSS comment?

//
<! !>
<!-- -->
/* */

16.

 Which of the following is not correct CSS syntax?

p, h1, h2 { color: green; }
<p style="border: 1px dotted #000000;"> </p>
p { border= 1px dotted #000000; }
p { border: 1px dotted #000000; }

17.

Which of the following examples will position a layered element toward the top of the stack?

top: -100px
top: 100px;
top: 100px;
position: static;

18.

Which of the following does CSS not do?

layout
content
design
style

19.

Can images replace the numbers/bullets in both ordered and unordered lists?

No
Yes
Maybe
None of the above