Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 2 : red, because an id selector outranks any number of class selectors. / लाल, क्योंकि id चयनकर्ता कितनी भी क्लास चयनकर्ताओं से ऊपर होता है।

Advertisement

Detailed Solution

सही उत्तर red, because an id selector outranks any number of class selectors. / लाल, क्योंकि id चयनकर्ता कितनी भी क्लास चयनकर्ताओं से ऊपर होता है। है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

Two rules target the same heading: '#header .title { color: red; }' and '.title.big { color: blue; }'. The heading sits inside the header element and carries both classes, with no inline style. The heading appears / दो नियम एक ही शीर्षक को लक्षित करते हैं: '#header .title { color: red; }' और '.title.big { color: blue; }'। शीर्षक header एलिमेंट के भीतर है, दोनों क्लासें धारण करता है, और कोई इनलाइन स्टाइल नहीं है। शीर्षक दिखेगा

1.
blue, because two classes always beat one id. / नीला, क्योंकि दो क्लासें हमेशा एक id को हराती हैं।
2.
red, because an id selector outranks any number of class selectors. / लाल, क्योंकि id चयनकर्ता कितनी भी क्लास चयनकर्ताओं से ऊपर होता है।
3.
blue, because the later rule in the file always wins. / नीला, क्योंकि फ़ाइल में बाद वाला नियम हमेशा जीतता है।
4.
black, because conflicting rules cancel each other. / काला, क्योंकि परस्पर विरोधी नियम एक-दूसरे को रद्द कर देते हैं।

Correct Answer: red, because an id selector outranks any number of class selectors. / लाल, क्योंकि id चयनकर्ता कितनी भी क्लास चयनकर्ताओं से ऊपर होता है।

Specificity compares id count first; one id outweighs any number of classes, and source order only breaks ties between equal specificity. / विशिष्टता में पहले id की गिनती की तुलना होती है; एक id कितनी भी क्लासों से भारी होता है, और स्रोत क्रम केवल समान विशिष्टता की बराबरी तोड़ता है।

Downloaded from PrepSnap (prepsnap.in)