Get the App
SLTechnology News&Howtos  ›  Development  › 

How css tiles the background image on the page

Shulou Source: shulou.com Published: 2022-06-01 10:29:33 09月30日 Update

This article mainly shows you the "css how to tile the background image on the page", the content is easy to understand, well-organized, hope to help you solve your doubts, the following let the editor lead you to study and learn "css how to tile the background image on the page" this article.

If you want to tile the image of the backer on the page, you can use the background-repeat attribute.

The attribute value repeat causes the image to be tiled vertically in the horizontal direction, just like the usual practice of setting images in the past. The division of repeat-x and repeat-y causes the image to be tiled only several times for horizontal or vertical purposes, while no-repeat does not allow the image to be tiled for the purpose of resignation.

By default, the background image will start from the upper left corner of an element. Take a look at the example above:

Body {bac kg round-image: url (/ i/eg_bg_03.gif); bac kg round-repeat: repeat-y;}

If you need to search for the efficacy of the above example, or give it a try.

Backing positioning

Perhaps manipulate the background-position attribute to reverse the image's position in backup.

The above example centers a background image in the body element:

Body {background-image:url ('/ iThromBGO); bac kilogram round-repeat:no-repeat; background-position:center;}

There are many doorways to supply values for the bac kilogram round-position property. First of all, some pivot words can be used: top, bottom, left, right and center. In general, these key words will be presented in pairs, but not always how. It is also possible to apply a length value, such as 100px or 5cm, or a percentage value at the end. The values of the same type are slightly different from the arrangement of the backing image.

Key word

The image placement hub word is the easiest to understand, and its persuasion is explained as it is commonly known. For example, top right places the image in the upper-right corner of the inner margin area of the element.

According to the scale, seat hub words can emerge in any way, as long as the guarantee is no more than two hub words-one corresponding to the level of left favouritism, the other corresponding to vertical left favouritism.

If only one crux word appears, the other key word is considered to be center.

The above is all the content of the article "how to tile the background image on the page by css". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Images images backgrounds pages attributes hubs elements content articles examples key points backing level purpose faceted transportable learning help application urgent Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MySQL Huawei Apple NVidia