CSS quiz questions

CSS interview questions

  • 1.

    Which of the following property of a anchor element signifies visited hyperlinks?

    1. :link

    2. :visited

    3. :hover

    4. :active

    Answer
  • 2.

    Which of the following property is used to set the color of a text?

    1. color

    2. direction

    3. letter-spacing

    4. word-spacing

    Answer
  • 3.

    Which of the following property is used to control the repetition of an image in the background?

    1. background-color

    2. background-image

    3. background-repeat

    4. background-position

    Answer
  • 4.

    Which of the following is correct about Short Hex Code format of CSS colors?

    1. This is a shorter form of the six-digit notation.

    2. In this format, each digit is replicated to arrive at an equivalent six-digit value.

    3. Each hexadecimal code will be preceded by a pound or hash sign '#'.

    4. All of the above.

    Answer
  • 5.

    Which of the following selector selects all paragraph elements whose lang attribute contains the word "fr"?

    1. p[lang]

    2. p[lang="fr"]

    3. p[lang~="fr"]

    4. p[lang|="fr"]

    Answer
  • 6.

    Which of the following selector matches all elements of a type?

    1. The Type Selector

    2. The Universal Selector

    3. The Descendant Selector

    4. The Class Selector

    Answer
  • 7.

    Which property is used to change the font of an element?

    1. font-family

    2. font

    3. Both font-family and font can be used

    Answer
  • 8.

    What is the default value of the position property?

    1. relative

    2. static

    3. absolute

    4. fixed

    Answer
  • 9.

    How do you group selectors?

    1. Separate each selector with a comma

    2. Separate each selector with a space

    3. Separate each selector with a plus sign

    Answer
  • 10.

    How do you select all p elements inside a div element?

    1. div p

    2. div + p

    3. div.p

    Answer
  • 11.

    How do you select elements with class name "test"?

    1. .test

    2. #test

    3. test

    4. *test

    Answer
  • 12.

    How do you select an element with id "demo"?

    1. *demo

    2. #demo

    3. .demo

    4. demo

    Answer
  • 13.

    How do you make a list that lists its items with squares?

    1. list-style-type: square;

    2. list: square;

    3. list-type: square;

    Answer
  • 14.

    When using the padding property; are you allowed to use negative values?

    1. Yes

    2. No

    Answer
  • 15.

    Which property is used to change the left margin of an element?

    1. padding-left

    2. margin-left

    3. indent

    Answer
  • 16.

    How do you display a border like this:
    The top border = 10 pixels
    The bottom border = 5 pixels
    The left border = 20 pixels
    The right border = 1pixel?

    1. border-width:10px 5px 20px 1px;

    2. border-width:5px 20px 10px 1px;

    3. border-width:10px 1px 5px 20px;

    4. border-width:10px 20px 5px 1px;

    Answer
  • 17.

    How do you make the text bold?

    1. font:bold;

    2. style:bold;

    3. font-weight:bold;

    Answer
  • 18.

    How do you make each word in a text start with a capital letter?

    1. You can't do that with CSS

    2. text-transform:capitalize

    3. text-transform:uppercase

    Answer
  • 19.

    How do you display hyperlinks without an underline?

    1. a {decoration:no-underline;}

    2. a {text-decoration:no-underline;}

    3. a {underline:none;}

    4. a {text-decoration:none;}

    Answer
  • 20.

    What is the correct CSS syntax for making all the <p> elements bold?

    1. p {font-weight:bold;}

    2. <p style="text-size:bold;">

    3. p {text-size:bold;}

    4. <p style="font-size:bold;">

    Answer

© 2017 QuizBucket.org