Get the App
SLTechnology News&Howtos  ›  Development  › 

How to achieve background Image Tile with css

Shulou Source: shulou.com Published: 2022-06-01 06:48:29 10月03日 Update

This article mainly introduces css how to achieve background picture tiling, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

Let's first take a look at how css sets the tiling of the background image.

Repeat: the default method, completely tiling the background

No-repeat: untiled in both X and Y axes

Repeat-x: tiling background horizontally

Repeat-y: tile the background vertically.

Css background image tiled completely tiled background code:

# content {

Border:1pxsolid#000fff

Height:500px

Background-image:url (https://cache.yisu.com/upload/information/20220117/488/49728.jpg);

Background-repeat:no-repeat

}

The tiling effect of css background image is as follows:

2345 Screenshot 20181008135659.png

The tiles of css background images are not tiled in the X and Y axes:

# content {

Border:1pxsolid#000fff

Height:500px

Background-image:url (images/tu.jpg)

Background-repeat:no-repeat

}

Thank you for reading this article carefully. I hope the article "how to achieve background picture tiling" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Background picture background picture article direction method code value interest at the same time screenshot effect more friends horizontal knowledge vertical editing industry information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn OPPO Reno macOS Microsoft Huawei