Background Position with CSS
📖 Scenario: You are creating a simple webpage section that uses a background image. You want to control where the background image appears inside the section.
🎯 Goal: Build a webpage with a <section> that has a background image. Use CSS to set the background image and then adjust its position to show different parts of the image.
📋 What You'll Learn
Create a
<section> element with a class hero in HTML.Add a background image to the
.hero class in CSS.Set the background position to
center initially.Change the background position to
top right later.Use CSS properties correctly and ensure the background image covers the section.
💡 Why This Matters
🌍 Real World
Background images are often used in website headers, banners, and sections to create visually appealing layouts.
💼 Career
Knowing how to control background images with CSS is a fundamental skill for front-end web developers and designers.
Progress0 / 4 steps