Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Customize Background Behavior | Сolors and Background
Introduction to CSS Part II
course content

Contenido del Curso

Introduction to CSS Part II

Introduction to CSS Part II

1. Text Styles
2. Сolors and Background
3. Layouts

bookCustomize Background Behavior

Now that we have gone over the background basics, some properties related to the background can be customized as required. Here is a detailed explanation of each property that can be set using the background shorthand property:

background-repeat

Specifies whether the background image should be repeated horizontally, vertically, or not at all. Valid values are repeat, repeat-x, repeat-y, and no-repeat. For example:

This prevents the background image from being repeated on the body element.

background-attachment

Specifies whether the background image should scroll with the rest of the page or stay fixed in place. Valid values are scroll and fixed. For example:

This sets the background image to stay fixed in place on the body element, even if the page is scrolled.

background-position

Specifies the position of the background image. This can be a keyword (such as center, top, or bottom), a length value, or a combination of the two. For example:

This centers the background image on the body element.

background-clip

Specifies whether the background image should be painted within the border box, padding box, or content box of an element. Valid values are border-box, padding-box, and content-box. For example:

This sets the background image to be painted within the content box of the body element.

background-origin

Specifies the position of the background image within the element's background positioning area. Valid values are border-box, padding-box, and content-box. For example:

This sets the background image to be positioned within the content box of the body element.

background-size

Specifies the size of the background image. This can be a keyword (such as cover or contain), a length value, or a combination of the two. For example:

This sets the background image to cover the entire body element.

1. Which of the following CSS color formats allows you to specify a color using hue, saturation, and lightness values?
2. Which of the following values can be used with the background-origin property to specify that the background image should be positioned relative to the border box of the element?
3. Which of the following is a valid CSS color format?
4. Fill in the blanks to specify a fixed, no-repeat background image that scales to cover the entire element
Which of the following CSS color formats allows you to specify a color using hue, saturation, and lightness values?

Which of the following CSS color formats allows you to specify a color using hue, saturation, and lightness values?

Selecciona la respuesta correcta

Which of the following values can be used with the background-origin property to specify that the background image should be positioned relative to the border box of the element?

Which of the following values can be used with the background-origin property to specify that the background image should be positioned relative to the border box of the element?

Selecciona la respuesta correcta

Which of the following is a valid CSS color format?

Which of the following is a valid CSS color format?

Selecciona la respuesta correcta

question-icon

Fill in the blanks to specify a fixed, no-repeat background image that scales to cover the entire element

body {
background-image: url(image.jpg);
background-attachment: ;
background-repeat:
;
background-size:
;
}

Click or drag`n`drop items and fill in the blanks

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 5
We're sorry to hear that something went wrong. What happened?
some-alt