Can you describe what a CSS Selector is?
Instruction: Explain the concept of CSS selectors and provide examples.
Context: This question tests the candidate's knowledge on CSS selectors, a fundamental concept for applying styles to HTML elements.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
A CSS selector describes which elements a rule can match. It can use an element name, class, ID, attribute, relationship or state. Matching a rule does not guarantee that every declaration in it wins the cascade.
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS example</title> <style> p { color: navy; } .notice { background: #fff4b8;...