Styling a Profile Card Using ID Selectors
📖 Scenario: You are creating a simple profile card for a website. The card has a title and a description. You want to style these elements individually using CSS ID selectors.
🎯 Goal: Build a small HTML page with a profile card. Use CSS ID selectors to style the card's title and description with different colors and font sizes.
📋 What You'll Learn
Create an HTML structure with a container
div having id="profile-card".Inside the container, add a heading
h2 with id="card-title" and a paragraph p with id="card-description".Write CSS rules using ID selectors to style
#card-title with a blue color and larger font size.Write CSS rules using ID selectors to style
#card-description with a gray color and smaller font size.💡 Why This Matters
🌍 Real World
ID selectors are used to style unique elements on a webpage, such as headers, buttons, or cards, making them stand out with specific styles.
💼 Career
Understanding ID selectors is essential for front-end developers to apply precise styles and create visually appealing web pages.
Progress0 / 4 steps