Get the App
SLTechnology News&Howtos  ›  Development  › 

What background attributes have been added to css3

Shulou Source: shulou.com Published: 2022-06-03 17:08:31 11月13日 Update

Editor to share with you what new background attributes in css3, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

1. The background is translucent, which means that the background of the box is translucent and the contents of the box are not affected.

Background: rgba; / * make text and borders transparent * / color: rgba; border: 1px solid rgba

2. The background zooms background-size. The attributes include PX value, percentage, cover and contain.

Attribute value action

Px value 1-2 pixel values, 1 value, proportional stretch in vertical direction; 2 values, normal load

The percentage value refers to the width and height attribute of the box

Cover automatically adjusts the zoom so that the background image is large enough to fully cover the background area. If there is an overflow, it will be hidden.

Contain automatically adjusts the zoom ratio to expand the image to its maximum size, ensuring that the picture is always displayed completely in the background area.

3. Multiple backgrounds.

Background-image: url (images/in_1.png), url (images/meng.jpg); these are all the contents of the article "what background attributes have been added to css3?" 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: Background attribute image content box article Zhongxin region scale percentage adjustment maximum less function pixel picture most size numerical value Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Redmi Linux Huawei Shulou Technology