Styling Multiple Elements with Group Selectors
📖 Scenario: You are creating a simple webpage for a local bakery. The bakery wants the headings and paragraphs to have the same text color and font style to keep the design consistent.
🎯 Goal: Build a CSS style using a group selector that applies the same color and font style to both <h1> and <p> elements on the page.
📋 What You'll Learn
Create an HTML skeleton with one
<h1> heading and two <p> paragraphs.Add a CSS group selector that targets both
h1 and p elements.Set the text color to
#6B4226 (a warm brown) and the font family to Arial, sans-serif for these elements.Ensure the CSS is linked properly in the HTML.
💡 Why This Matters
🌍 Real World
Group selectors help keep website styles consistent and reduce repeated code, making it easier to maintain and update designs.
💼 Career
Web developers use group selectors daily to efficiently style multiple elements, improving website appearance and user experience.
Progress0 / 4 steps