Try to answer these 800+ CSS MCQs and check your understanding of the CSS subject. Scroll down and let's begin!

1: Which property is used to specify table borders in CSS?

A.   dimension

B.   edge

C.   border

2: The_____________ property indicates whether a cell without any content should have a border displayed.

A.   nocontent-cells

B.   empty-cells

C.   noborder-cells

D.   blank-cells

3: In the CSS box model, where is the margin located?

A.   Immediately within the box border

B.   Immediately outside the box border

C.   None of these

D.   Between the padding and the box border

4: Which of the following is true about vertical-align property?

A.   To vertically align an image: img { vertical-align:text-top; }

B.   It sets the vertical alignment of an element.

C.   It sets the vertical alignment of an the entire webpage.

5: Internet Explorer supports the fixed value only if...

A.   !DOCTYPE is specified.

B.   !DOCTYPE is not specified.

C.   header is specified.

6: Which property is used to control the space between the border and content in a table?

A.   spacing

B.   align

C.   padding

7: The _________ means an element that has the user's mouse pointer hovering over it.

A.   a:visited

B.   a:hover

C.   a:link

8: Which of the following increases or decreases the horizontal space between characters?

A.   tracking

B.   letter-spacing

C.   kerning

A.   a:active

B.   a:unvisited

C.   a:visited

D.   a:link

E.   a:hover

10: Which property is used to change the background color?

A.   backgroundcolor:

B.   background-color:

C.   color-bkgd:

D.   bgcolor:

E.   color-background:

11: Which properties can be applied to first-line pseudo-element?

A.   font properties

B.   vertical-align

C.   background properties

D.   All of these

E.   word-spacing

12: The background color can be specified by:

A.   a HEX, e.g., #00ff00

B.   All of these

C.   an RGB value, e.g., rgb(255,0,255)

D.   a color name, e.g., yellow

13: .css files may be created using what software?

A.   BBEdit

B.   TextMate

C.   All of these, any text editor will do.

D.   Sublime Text

14: Which contemporary web browser(s) support CSS?

A.   All of these

B.   Chrome

C.   Firefox

D.   Internet Explorer

15: What is the correct HTML for referring to an external style sheet?

A.   <link rel="stylesheet" type="text/css" href="mystyle.css">

B.   <stylesheet>mystyle.css</stylesheet />

C.   <style src="mystyle.css" />

16: What does CSS stand for?

A.   Common Style Syntax

B.   Computer Style Sheets

C.   Cascading Style Sheets

D.   Creative Style Sheet

17: Which character, followed by the selector's name, is used for defining ID selectors?

A.   #

B.   !

C.   &

D.   %

18: Which symbol is used to define an ID?

A.   $ (dollar sign)

B.   @ (the "at" symbol)

C.   % (percent sign)

D.   ! (exclamation point)

E.   # (pound sign)

19: What should CSS be used for?

A.   just themes

B.   styling

C.   structure

D.   scripting

20: Where in an HTML document is the correct place to refer to an external style sheet?

A.   In the <body> section

B.   At the beginning of the document

C.   In the <head> section

D.   At the end of the document

21: Which HTML tag is used to define an internal style sheet?

A.   <script>

B.   <style>

C.   <css>

22: Which of these is the correct CSS syntax for specifying the left margin of an element?

A.   {p = margin-left:20px}

B.   p {margin-left:20px;}

C.   {p: margin-left:20px;}

D.   {p: margin-left:(20px)}

23: An ID is prefaced by what symbol?

A.   #

B.   </

C.   @

D.   <

E.   .

24: What is the extension for an external style sheet?

A.   .style

B.   .sass

C.   .styles

D.   .theme

E.   .css

25: Which configuration of the web elements in the page markup gives you great flexibility in the design of your site?

A.   margins

B.   padding

C.   border

D.   All are correct

26: CSS stands for

A.   Common Style for Strings

B.   Cascading Style for Strings

C.   Common Style Sheets

D.   Cascading Style Sheets

E.   Community Specification of Styles

27: Which of the following determines whether the text should be displayed as italics or regular text?

A.   font-style

B.   foont

C.   styles-font

D.   foont-styles

E.   font-decoration

28: In an HTML document, where is the correct place to refer to an external CSS file?

A.   In the <title> section

B.   In the <head> section

C.   In the <body> section

D.   At the end of the document

29: Which tag is used to define an Internal Style Sheet?

A.   <style>

B.   <script>

C.   <iss>

D.   <internal>

30: How do you add a background color for all <h1> elements?

A.   h1.all {background-color:#FFFFFF;}

B.   all.h1 {background-color:#FFFFFF;}

C.   h1 {background-color:#FFFFFF;}

A.   To request a sandwich

B.   It does nothing

C.   To call an internal stylesheet

D.   To call an external stylesheet

32: Dimension properties allow you to control:

A.   the text size in an element

B.   the color of an element

C.   the height and width of an element

33: Who maintains CSS?

A.   W3C

B.   Mozilla

C.   Apple

D.   Microsoft

E.   Google

A.   When the user clicks it

B.   It is a normal link

C.   When the user mouses over it

D.   When the user has visited it

35: The id selector uses the id attribute of the HTML element, and is defined with a

A.   "%"

B.   "_"

C.   "#"

D.   "@"


37: What css selector selects all elements?

A.   *

B.   !

C.   ^

D.   ~

38: Which is the correct way to write a comment in CSS?

A.   /*This is a comment*/

B.   </ This is a comment />

C.   #This is a comment#

D.   //This is a comment

39: Is this a proper statement? body { font-family: Arial, Helvetica, sans-serif; color: #000; background-color: #FFF; }

A.   No

B.   Yes

40: Pseudo-elements can be combined with CSS classes.

A.   False

B.   True

41: Which property can be used to set the color of a text?

A.   color

B.   color-spacing

C.   color-space

42: What does the background-color property do?

A.   Returns "true" if the background color matches another element

B.   Specifies the background color of an element

C.   Copies the background color from another element

D.   Specifies the background image

43: Which of the following properties is used to set a minimum width on an element?

A.   hsize

B.   size

C.   x-spacing

D.   min-width

E.   width

44: Which CSS property controls the text size?

A.   font-style

B.   text-style

C.   font-size

D.   text-size

E.   size-font

45: The outline property is used to control:

A.   all of these

B.   color of outline

C.   width of outline

D.   style of outline

46: Which property can be used, along with a position property, to create an effect of layers?

A.   y-index

B.   a-b testing

C.   x-index

D.   z-index

47: Which of the following is correct CSS syntax?

A.   body {color: black;}

B.   {body:color=black(body};

C.   body:color=black;

D.   {body;color:black;}

48: Which is the correct CSS syntax?

A.   body { color: red; }

B.   { body: color=black(body }

C.   { body; color: black }

D.   body:color=black

E.   body { color; red }

49: What property alters an elements background color?

A.   color

B.   bgcolor

C.   background-color

50: The class selector is used to specify a style for:

A.   the <p > tag

B.   a group of elements

C.   the <head> tag

D.   the <a> tag