top of page

CSS MCQ Questions with Answer

Updated: Sep 15, 2022


Q 1. What is CSS?

a. CSS is a style sheet language

b. CSS stands for Cascading style sheet.

c. CSS is used to style the HTML documents

d. All of the mentioned

Answer: d

Q2.Which CSS property used to control the element’s font-size is

a. font-size

b. text-size

c. text-style

d. None

Answer: a

Q.3 Which CSS selector is used for unique element?

a. Id

b. text

c. class

d. name

Answer: a

Q. 4What is the correct syntax for referring an external CSS?

a. <link rel="stylesheet" type="text/css" href="mycss.css">

b. <stylesheet rel="stylesheet" type="text/css" href="mycss.css">

c. <style rel="stylesheet" type="text/css" href="mycss.css">

d. All of the above

Answer: a

Q. 5 Where is the correct place for external css in HTML document?

a. In <head> section

b. At the end of the document

c. In the <body> section

d. At the top of the document

Answer: a

Q. 6 There is a CSS rule for paragraphs tags in a CSS file, p can be called?

a. Selector

b. Attribute

c. Property

d. Tag

Answer: a

Q. 7 Internal styles are written within below code.

a. <style>…</style>

b. <css>…</css>

c. <stylesheet>…</stylesheet>

d. Both a and b

Answer: a

Q. 8 which tag used for internal CSS?

a. <css>

b. <script>

c. <style>

d. None

Answer: c

Q.9 which text property defines the minimum and maximum between words in CSS?

a. word-wrap

b. word spacing

c. word-break

d. white-space

Answer: b

Q.10 we want to change in entire website by changing one file css, which type css used for it?

a. Inline CSS

b. Internal CSS

c. External CSS

d. Both Inline and Internal CSS

Answer: c

Q. 11 which property is used to change the background color of an element in CSS?

a. bgcolor

b. color

c. background-color

d. None of Above

Answer: c

Q. 12 Which CSS property will be used for don't want to allow a floating div to the left side of an element?

a. margin

b. clear

c. float

d. padding

Answer: b

Q. 13 which syntax is correct to display the hyperlinks without any underline?

a. a {decoration : no-underline;}

b. a {text-decoration : underline;}

c. a {text-decoration : none;}

d. None

Answer: c

Q.14 which is the correct syntax to make the background-color of all paragraph elements to yellow?

a. all {background-color : yellow;}

b. p {background-color : #yellow;}

c. p {background-color : yellow;}

d. all p {background-color : #yellow;}

Answer: c

Q.15 which property is used as the shorthand property for the padding properties?

a. padding-right

b. padding-left

c. padding

d. None of the above

Answer: c

Q.16 which has introduced text, list, box, margin, border, color, and background properties?


b. PHP

c. CSS

d. Ajax

Answer: a

Q. 17 which is used to create a responsive design?

a. javascript

b. rails

c. ajax

d. bootstrap

Answer: d

Q. 18 which is used to specify a rule to bind a particular unique element in CSS selector?

a. tag

b. id

c. class

d. both class and tag

Answer: b

Q. 19 which is the correct CSS syntax in HTML?

a. body{color:black}

b. {body;color:black}

c. {body:color=black(body)}

d. body:color=black

Answer: a

Q. 20 which is the CSS comments

a. //

b. /* and */

c. <* and *>

d. // //

Answer: b.

21. Which property is used to define the font of the element's text in CSS?

a. font

b. font-family

c. font-style

d. None of the above

Answer: b

Q. 22 How to add a background color for all <h2> elements?

a. all.h2{backgorund-color:#FFFFFF

b. h2.all{backgorund-color:#FFFFFF

c. h2{backgorund-color:#FFFFFF

d. None of Above

Answer: c

Q. 23 which CSS property is used for text italic?

a. font

b. font-family

c. font-style

d. None of the above

Answer: c

Q. 24 which attribute is used for text bold

a. font-weight : bold

b. weight: bold

c. font: bold

d. style: bold

Answer: a

Q.25 Negative values are allowed in padding property.

a. Yes

b. No

c. Can't say

d. May be

Answer: b

Q. 26 which css property is used for wrap a block of text around an image

a. wrap

b. push

c. float

d. align

Answer: c

Q. 27 How to select the elements with the class name “careerbodh”?

a. career

c. careerbodh

d. .careerbodh

Answer: d

Q. 28 which syntax is correct in CSS to make each word of a sentence start with a capital letter?

a. transform : capitalize;

b. text-style : capital;

c. text-transform : capital;

d. text-transform : capitalize;

Answer: d

Q. 29 which are the valid values of font-style property?

a. italic, bold, bolder

b. normal, bold, italic

c. underline, bold, italic

d. inherit, italic, normal, oblique

Answer: d

Q.30 which is CSS property is used to specify the transparency of an element?

a. opacity

b. filter

c. visibility

d. overlay

Answer: a

Q. 31 which is the correct syntax of border property in CSS?

a. border: border-width border-style border-color

b. border: border-color border-width border-style

c. border: border-style border-width border-color

d. None of the above

Answer: a

Q. 32 Which CSS property is used to change color from Mouse over?

a. a:mouseover

b. a:move

c. a:mover

d. a:hover

Answer: d

Q.33 How to change the left margin of an element?

a. margin

b. indent

c. margin-left:

d. text-indent:

Answer: c

Q.34 Which CSS property is used to specify the space between every letter inside an element?

a. alpha-spacing

b. character-spacing

c. letter-spacing

d. alphabet-spacing

Answer: c

Q. 35 which attribute is used a dotted border around an image?

a. border-color

b. border-decoration

c. border-style

d. border-line

Answer: c

Q.36 Which CSS property is used to specify whether the text is written in the horizontal or vertical direction?

a. text-indent

b. writing-mode

c. word-break

d. None


Q. 37 which are the valid values of text-align property?

a. left, middle, right

b. left, center, right

c. left, center, right, justify

d. left, middle, right, justify

Answer: c

Q. 38 The correct syntax to select all paragraph elements in a div element is ….

a. div p

b. p

c. div#p

d. div ~ p

Answer: a

Q.39 Which CSS property is used to draw a line around the elements outside the border?

a. line

b. border

c. padding

d. outline

Answer: d

Q.40 Which CSS property is used to specify table borders in CSS?

a. table:border

b. table

c. border

d. none of the mentioned

Answer: c

Q.41 Which is the correct syntax to select the p siblings of a div element?

a. p

b. div p

c. div + p

d. div ~ p

Answer: d

Q.42 Which CSS property is used to add some margin between a DIV's border and its inner text?

a. spacing

b. margin

c. padding

d. inner-margin

Answer: c

Q. 43 The default value of position attribute is

a. fixed

b. absolute

c. inherit

d. relative

Answer: d

Q. 44 Which CSS property is used to add shadows to the text?

a. text-shadow

b. text-stroke

c. text-overflow

d. text-decoration

Answer: a

Q. 45 Which CSS property is used to specify the indentation of the first line of a text?

a. text-align-left

b. padding-left

c. margin-left

d. text-indent

Answer: d

Q.46 Which is not a value of the font-variant property in CSS?

a. normal

b. small-caps

c. large-caps

d. inherit

Answer: c

Q.47 Which CSS property is used to specify whether the table cells share the separate border?

a. border-collapse

b. border-radius

c. border-spacing

d. All of the above

Answer: a

Q. 48 Which selector in CSS is used to select the elements that do not match the selectors?

a. :! selector

b. :not selector

c. :empty selector

d. All of the above

Answer: b

Q. 49 Which is not a type of combinator?

a. >

b. ~

c. +

d. *

Answer: d

Q. 50 Which CSS property defines how an image or video fits into container with established height and width?

a. object-fit

b. object-position

c. position

d. All of the above

Answer: a

Q. 51The correct CSS statement is used to remove the markers/bullets?

a. list-style: none;

b. list-style-type: 0;

c. list-style-type: blank;

d. list-style-type: none;

Answer: d

Q.52 Which type of CSS in the below code?

<p style = "border:2px solid red;">

a. Inline CSS

b. Internal CSS

c. External CSS

d. All of the above

Answer: a

Q. 53 Which CSS function performs a calculation to be used as the property value?

a. sum()

b. add()

c. calc()

d. addition()

Answer: c

Q. 54 In below code, identify the selector

p {border: 2px solid blue;}

a. p

b. border

c. 2px

d. None of these

Answer: a

Q. 55 How many color supports in CSS?

a. 140

b. 100

c. 75

d. 90

Answer: a

Q.56 Which selector is used to selects all the <h> elements where the parent is a <div> element.

a. h + p

b. h > p

c. p.h

d. p > h

Answer: b

Q. 57 Which CSS property is used to specify the type of quotation mark?

a. quotes property

b. z-index property

c. hyphens property

d. All of the above

Answer: a

Q. 58 Below code represents a universal selector?

a. *{border: 2px solid red;}

b. body {border: 2px solid red;}

c. both A&B

d. None of Above

Answer: a

Q. 59 Below code represent

p {display: flex;}

a. All the <p> elements are displayed as a block-level flex container

b. All the <p> elements are not displayed by the browser

c. All the <p> elements are displayed as a grid container

d. All the <p> elements are displayed as an inline flex container

Answer: a.

Q. 60 Which CSS3 property can be used to allow line breaks within words?

a. line-breaks

b. lines-wrap

c. words-break

d. word-break

Answer: d

844 views0 comments

Recent Posts

See All

Java Script MCQ Questions

Q1. JavaScript was invented by W3- Group Hel Sinki Linux Brendan Eich None Ans: C Q2. Variable can hold which type of value at a time:- A.    Multiple B.     Single C.     Double D.    None Ans: B Q3.


bottom of page