Curriculum
Course: CSS
Login

Curriculum

CSS

CSS INTRODUCTION

0/1

CSS Selectors

0/1

CSS Comments

0/1

CSS Padding

0/1

CSS Box Model

0/1

CSS Combinators

0/1

CSS Pseudo-classes

0/1

CSS Pseudo-elements

0/1

CSS Dropdowns

0/1

CSS Image Gallery

0/1

CSS Image Sprites

0/1

CSS Counters

0/1

CSS Website Layout

0/1

CSS Specificity

0/1

CSS Math Functions

0/1
Text lesson

Background Image

CSS background-image

The background-image property designates an image to be utilized as the background of an element.

By default, the image is tiled to cover the entire element.

Example

Apply a background image to a page.

body {
  background-image: url(“paper.gif”);
}

Example

This example presents an unfavorable pairing of text and background image, resulting in poor readability of the text.

body {
  background-image: url(“bgdesert.jpg”);
}

 

Please be advised: When employing a background image, ensure that the image does not disrupt the legibility of the text. 

 

 

You can also assign a background image to specific elements, such as the <p> element.

Example

{
  background-image: url(“paper.gif”);
}

 The CSS Background Image Property

Property

Description

background image

Defines the background color of an element.