# background

background 是一种 CSS 简写属性,用于一次性集中定义各种背景属性,包括 color, image, origin 与 size, repeat 方式等等。

# # Syntax

background: [ <bg-layer> , ]* <final-bg-layer>;

# # Values

fixed The background is fixed with regard to the viewport. In paged media where there is no viewport, a 'fixed' background is fixed with respect to the page box and therefore replicated on every page.

local The background is fixed with regard to the element's contents: if the element has a scrolling mechanism, the background scrolls with the element's contents.

none A value of 'none' counts as an image layer but draws nothing.

scroll The background is fixed with regard to the element itself and does not scroll with its contents. (It is effectively attached to the element's border.)

# # Compatibility

# # uni-app compatibility

Android version Android uni-app Android uni-app-x iOS version iOS uni-app iOS uni-app-x
background 5.0 3.9+ 9.0 -

# # See also