CSS Backgrounds

Learn how to style backgrounds using CSS.

Back to CSS Topics

Step 1: Learn the Basics

CSS allows you to set background colors and images. Example:

<style>
    body {
        background-color: lightblue;
        background-image: url('background.jpg');
        background-repeat: no-repeat;
        background-size: cover;
    }
</style>

Step 2: Try It Yourself

Write CSS to set a background color of **yellow** and an image that covers the whole screen.