Styling All Elements with the Universal Selector
📖 Scenario: You are creating a simple webpage and want to apply a basic style to every element to ensure consistent spacing and font style.
🎯 Goal: Use the CSS universal selector * to apply a margin of 0 and a font family of Arial, sans-serif to all elements on the page.
📋 What You'll Learn
Create a CSS rule using the universal selector
*Set the
margin property to 0 for all elementsSet the
font-family property to Arial, sans-serif for all elements💡 Why This Matters
🌍 Real World
Web designers often use the universal selector to reset or normalize styles across all elements to create a consistent base for their designs.
💼 Career
Understanding the universal selector helps in writing efficient CSS that applies broad styles quickly, a common task in front-end web development.
Progress0 / 4 steps