CSS background-repeat အကျုပ်

Definition and usage

background-repeat Whether and how the background image is repeated based on the attribute settings.

By default, the background image is repeated in both horizontal and vertical directions.

Detailed explanation

The background-repeat property defines the tiling mode of the image.

Start repeating from the original image, where the original image is background-image Define, and based on background-position value placement.

See also:

CSS Tutorial:CSS နောက်ခံ

CSS Reference Manual:background-position property

HTML DOM Reference Manual:backgroundRepeat property

Example

body
  {
  background-image: url(stars.gif);
  background-repeat: repeat-y;
  }

Try it yourself

Tips and comments

Tip:The position of the background image is set by the background-position property. If the background-position property is not specified, the image will be placed at the top left corner of the element.

CSS syntax

background-repeat: repeat|repeat-x|repeat-y|no-repeat|initial|inherit;

Attribute value

Attribute value

Value Description
repeat Default. The background image will be repeated vertically and horizontally.
repeat-x The background image will be repeated horizontally.
repeat-y The background image will be repeated vertically.
no-repeat The background image will be displayed only once.
inherit Specifies that the background-repeat property settings should be inherited from the parent element.

Technical details

Default value: repeat
Inheritance: no
Version: CSS1
JavaScript syntax: object.style.backgroundRepeat="repeat-y"

More examples

How to repeat the background image vertically
This example demonstrates how to repeat the background image vertically.
How to repeat the background image horizontally
This example demonstrates how to repeat the background image horizontally.
How to display the background image only once
This example demonstrates how to display the background image only once.

Browser support

The numbers in the table indicate the first browser version that fully supports this attribute.

Chrome Edge Firefox Safari Opera
Chrome IE / Edge Firefox Safari Opera
1.0 4.0 1.0 1.0 3.5