CSS MCQs

CSS MCQs

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.   "@"

36:

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

51: Which of these is the correct way to specify color?

A.   h1 {color:#00ff00;}

B.   body {color:blue;}

C.   h2 {color:rgb(255,0,0);}

D.   All of these

52: Which of the following is NOT a web-safe font?

A.   Verdana

B.   Arial

C.   Times New Roman

D.   Zapfino

E.   Georgia

53: Which property is used to specify the kind of border to display?

A.   border-kind

B.   border-display

C.   border-design

D.   border-style

54: They must be define a border-style for the border to show up. Available terms:

A.   All are correct

B.   thick

C.   medium

D.   thin

55: CSS colors are defined using a _________ notation for the combination of red, green and blue (rgb) color values.

A.   pentadecimal

B.   hexadecimal

C.   nanodecimal

D.   octadecimal

A.   a:link {background-color:@B2FF99;}

B.   a:link {background-color:!B2FF99;}

C.   a:link {background-color:#B2FF99;}

D.   a:link {background-color:%B2FF99;}

A.   a:hover

B.   mouse over

C.   a:over

D.   a:link

58: .center {text-align:center;} is an example of

A.   the ID Selector

B.   the class Selector

C.   an html tag

59: What are the possible values of the property background-attachment?

A.   fixed

B.   Both scroll and fixed

C.   scroll

60: When does aligning a block element have no effect?

A.   when it's width is set to 100%

B.   when it's width is set to 50%

A.   <link>

B.   <sheet>

C.   <external>

D.   <ess>

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

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

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

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

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

63: A ___________ property can help you to create more complex webpage layouts

A.   y-index

B.   z-index

C.   x-index

64: What symbol do you use in CSS to call out to an ID?

A.   id=""

B.   #

C.   @

D.   $

E.   .

65: Which of these is the correct format for specifying a color?

A.   #fff

B.   #ffffff

C.   All of the above

D.   rgb(255,255,255)

E.   white

66: The CSS list properties allow you to:

A.   Set different list item markers for ordered lists

B.   Set different list item markers for unordered lists

C.   All are correct

D.   Set an image as the list item marker

67: Which CSS property can provide an effect when changing from one style to another, without using Flash animations or JavaScript?

A.   transparency

B.   association

C.   transistor

D.   transition

68: What does CSS define in HTML?

A.   How to display HTML elements

B.   How to save HTML elements

C.   How to send HTML elements

D.   How to create HTML elements

69: How do you make the text bold?

A.   font-weight: bold;

B.   text: BOLD!

C.   font: b;

D.   style: bold;

70: What do the height and width CSS dimension properties allow you to control?

A.   the importance order of the cascade

B.   the depth of nested divs

C.   the height and width of an element

D.   2d and 3d dimensions

71: What is the default file extension for a CSS style sheet?

A.   .css

B.   .style

C.   .main

D.   .styles

A.   a {font: decoration: none}

B.   a {text-decoration: u}

C.   a: font-decoration: underline

D.   a {text-decoration: underline}

73: Which property can be used to control the flow and formatting of text?

A.   green-space

B.   blue-space

C.   white-space

D.   red-space

74: How do you add a background color?

A.   div {bgcolor = red}

B.   div {background-color = red}

C.   div {background-color : red}

D.   div {bgcolor : red}

75: In CSS, it is possible to specify different padding for different sides?

A.   Yes

B.   No

C.   Only for images

D.   Only for <P> tags

76: Is :focus a pseudo-class?

A.   No

B.   Yes

77: True or False: Hexadecimal color values are supported in all major browsers.

A.   True

B.   False

78: In which example below will all HTML elements with class="master" will be center-aligned?

A.   .center {text-:master;}

B.   master -align:center;}

C.   #master{text-align:center;}

D.   .master {text-align:center;}

E.   master:center

79: Which of the following CSS3 properties is used to round the corners of elements?

A.   border-curve

B.   rounded-corners

C.   border-radius

80: Which of the following characters is used to end a css declaration block?

A.   >

B.   None of these

C.   )

D.   }

E.   ]

81: Which of the following CSS declarations would change the border style?

A.   border-width: solid;

B.   borderstyle solid;

C.   border-style: solid;

D.   border-weight: solid;

82: In reality layers are often used in more dynamic ways:

A.   All are correct

B.   Flying elements/banners on the page

C.   Menus that pop out when triggered

D.   Games where you move an object around

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

A.   "#"

B.   :."

C.   "."

D.   "{ }"

E.   "d"

84: Which answer best describes the following css rule? a {text-decoration:none;}

A.   It is invalid

B.   Links will be styled with no underlines

C.   Paragraphs will have hidden text

D.   It's an anchor with no ship

A.   text-trans

B.   text-transformation

C.   text-decoration

86: Hex colors are based off of what other web based color mode?

A.   Indexed

B.   CMYK

C.   Grayscale

D.   RGB

87: Which of the following places one or more images in the background of the element?

A.   bgimage

B.   imagesbackground

C.   background-img

D.   background-image

E.   image-bg

88: Which value is used to define a dashed border?

A.   dashed

B.   dotted

C.   dashing

89: Which is the correct syntax for centering the text in the header?

A.   p {text-align: center}

B.   h1 {font-align: centered;}

C.   h1 {text-align: center;}

D.   h1 {text-align: centered;}

90: How to apply the text-shadow around the text?

A.   <p.all style="text-shadow:6px 6px 10px #FF0000 "> Text-shadow is of red color. </p>

B.   <p style="text-shadow:6px 6px 10px #FF0000 "> Text-shadow is of red color. </p>

C.   <all.p style="text-shadow:6px 6px 10px #FF0000 "> Text-shadow is of red color. </p>

91: Which states whether the text is underlined or not?

A.   text-spacing:

B.   text-shadow:

C.   text-decoration:

D.   text-transform:

92: What does background-origin property do?

A.   It specifies the background text.

B.   It specifies the background color.

C.   It specifies the positioning area of the background images.

93: What's the name of the layout technique that relies on CSS3 media queries to apply different styles based on the width of the browser window?

A.   Elastic

B.   Fluid

C.   Liquid

D.   Responsive

94: Which styles of border can be look in dotted?

A.   border-style: dotted;

B.   border-style: dashed;

C.   border-style: solid;

D.   border-style: outset;

95: What does the float property do?

A.   Allows web designers to overlap elements or to stack them on top of each other

B.   Allows users to drag and drop images to another location on the page

C.   Aligns HTML elements to the right or left while allowing content to flow around it

96: How do you designate an inline style?

A.   inline = " "

B.   href = " "

C.   css = " "

D.   src = " "

E.   style = " "

97: Colors in CSS can be specified by the following methods:

A.   Hexadecimal colors

B.   HSL colors

C.   HSLA colors

D.   All of these

E.   RGB colors

98: Which of the following always refers to text color?

A.   font-color

B.   color

C.   text-color`

D.   hue

99: What property is used to a set minimum height for an element?

A.   min: height

B.   min-height

C.   minimum-height

D.   m-heights

100: What is the correct selector format for ID elements in CSS, where id_name is unique ID name to be formatted?

A.   #id_name { }

B.   .id_name { }

C.   if id=id_name then { }

D.   /* idname { } */