This set of CSS Multiple Choice Questions & Answers (MCQs) focuses on “Specificity and Importance”.
Find the specificity of the statments using the rule given below.
A selector’s specificity is calculated as follows:
1) count 1 if the declaration is from is a ‘style’ attribute rather than a rule with a selector, 0 otherwise (= a) (In HTML, values of an element’s “style” attribute are style sheet rules. These rules have no selectors, so a=1, b=0, c=0, and d=0.)
2) count the number of ID attributes in the selector (= b)
3) count the number of other attributes and pseudo-classes in the selector (= c)
4) count the number of element names and pseudo-elements in the selector (= d)
1. Find the specificity of this “*”.
a) specificity = 0,0,0,0
b) specificity = 0,0,0,1
c) specificity = 0,0,1,0
d) specificity = 1,0,0,0
View Answer
Explanation: Self-explainatory.
2. Find the specificity of this “li”.
a) specificity = 0,0,0,1
b) specificity = 0,0,1,1
c) specificity = 0,1,1,1
d) specificity = 1,1,1,1
View Answer
Explanation: Self-explainatory.
3. Find the specificity of this ” ul li”.
a) specificity = 0,0,0,0
b) specificity = 0,0,1,2
c) specificity = 0,0,0,2
d) specificity = 2,0,0,0
View Answer
Explanation: Self-explainatory.
4. Find the specificity of this “li:first-line”.
a) specificity = 0,0,1,1
b) specificity = 0,0,0,2
c) specificity = 0,1,0,1
d) specificity = 1,0,0,1
View Answer
Explanation: Self-explainatory.
5. Find the specificity of this “ul ol+li”.
a) specificity = 0,0,2,1
b) specificity = 0,2,1,1
c) specificity = 0,1,1,1
d) specificity = 0,0,0,3
View Answer
Explanation: Self-explainatory.
6. Find the specificity of this “ul ol li.red”.
a) specificity = 0,0,3,1
b) specificity = 0,0,1,3
c) specificity = 1,1,1,1
d) specificity = 1,2,2,1
View Answer
Explanation: Self-explainatory.
7. Find the specificity of this “ul ol li.red”.
a) specificity = 0,0,1,3
b) specificity = 0,0,0,4
c) specificity = 0,1,2,1
d) specificity = 1,1,1,1
View Answer
Explanation: Self-explainatory.
8. Find the specificity of this “li.red.leve”.
a) specificity = 2,0,0,1
b) specificity = 0,0,1,1
c) specificity = 0,2,0,1
d) specificity = 0,0,2,1
View Answer
Explanation: Self-explainatory.
9. Find the specificity of this “#x34y”.
a) specificity = 0,0,0,1
b) specificity = 0,0,1,0
c) specificity = 0,1,0,0
d) specificity = 1,0,0,0
View Answer
Explanation: Self-explainatory.
10. Find the specificity of this ” style=”” “.
a) specificity = 0,0,0,1
b) specificity = 0,0,1,0
c) specificity = 0,1,0,0
d) specificity = 1,0,0,0
View Answer
Explanation: Self-explainatory.
Sanfoundry Global Education & Learning Series – CSS.
To practice all areas of CSS, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Apply for Computer Science Internship
- Practice Computer Science MCQs
- Check CSS Books
- Check Computer Science Books
- Practice MCA MCQs