Css Selectors And Css Files(Css ) Questions and Answers

Question 1. Which of the following CSS list properties is/are correct?
  1.    Set different list item markers for ordered lists
  2.    Set different list item markers for unordered lists
  3.    Set an image as the list item marker
  4.    All of the mentioned
Explanation:-
Answer: Option D. -> All of the mentioned

Question 2. The _______property is used to set the color of the text.
  1.    pallet
  2.    colour
  3.    color
  4.    text-decoration
Explanation:-
Answer: Option C. -> color

Question 3. Which of the following is the correct way to apply Styles?
  1.    inside an HTML element
  2.    inside the section of an HTML page
  3.    in an external CSS file
  4.    all of the mentioned
Explanation:-
Answer: Option D. -> all of the mentioned

Question 4. What will happen in this case?
text
  1.    make that specific paragraph red.
  2.    error
  3.    nothing happens
  4.    none of the mentioned
Explanation:-
Answer: Option A. -> make that specific paragraph red.

Question 5. Which of the following is the correct way to applying style to a document?
  1.    Use an external style sheet, either by importing it or by linking to it
  2.    Directly embed a document-wide style in the head element of the document
  3.    Set an inline style rule using the style attribute directly on an element
  4.    All of the mentioned
Explanation:-
Answer: Option D. -> All of the mentioned

Question 6. A ___________ is used to define a special state of an element.
  1.    pseudo-tag
  2.    pseudo-element
  3.    pseudo-id
  4.    pseudo-class
Explanation:-
Answer: Option D. -> pseudo-class

Question 7. Which of the following selector selects the elements that are the default among a set of similar elements?
  1.    :default
  2.    :%
  3.    :disabled
  4.    none of the mentioned
Explanation:-
Answer: Option A. -> :default
Example: :default {background-color: red;}

Question 8. Which of the following selector selects all elements of E that have the attribute attr that end with the given value?
  1.    E[attr^=value]
  2.    E[attr$=value]
  3.    E[attr*=value]
  4.    none of the mentioned
Explanation:-
Answer: Option B. -> E[attr$=value]
Example: p[title$="!"] {color: red;}

Question 9. The __________ property specifies the type of positioning method used for an element.
  1.    align
  2.    float
  3.    position
  4.    padding
Explanation:-
Answer: Option C. -> position

Question 10. Which of the following selector selects the elements that are checked?
  1.    E ~ F
  2.    ::after
  3.    :checked
  4.    none of the mentioned
Explanation:-
Answer: Option C. -> :checked
Example: :checked {color: blue;}