• Post category:CSS

Background Image Repeat in CSS

Background Image Repeat in CSS

In this article, we will show about Let’s see how to stop background image repeat. We face this problem only when we insert a background image in CSS. So, To stop the background image from repeating, use the CSS “background-repeat” property and give the value “n0-repeat”.

Example code

body{
background-image: url("images.jpg");
}

background image repeat in css

Here I have inserted an image for the body section. By default, the image is repeated throughout the space. So, we can solve this problem easily, to solve follow the next step.

body{
background-image: url("images.jpg");
background-repeat: no-repeat;
}

background image repeat in css

See the output, the repeat image is not shown. We should set the “background-repeat” property to “no-repeat”.

Leave a Reply