Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS background-image 属性 #19

Open
Seasons123 opened this issue May 18, 2017 · 0 comments
Open

CSS background-image 属性 #19

Seasons123 opened this issue May 18, 2017 · 0 comments

Comments

@Seasons123
Copy link
Owner

Seasons123 commented May 18, 2017

http://www.w3school.com.cn/cssref/pr_background-image.asp
定义和用法

background-image 属性为元素设置背景图像。
元素的背景占据了元素的全部尺寸,包括内边距和边框,但不包括外边距。

默认地,背景图像位于元素的左上角,并在水平和垂直方向上重复。
提示:请设置一种可用的背景颜色,这样的话,假如背景图像不可用,页面也可获得良好的视觉效果。
详细说明

background-image 属性会在元素的背景中设置一个图像。
根据 background-repeat 属性的值,图像可以无限平铺、沿着某个轴(x 轴或 y 轴)平铺,或者根本不平铺。
初始背景图像(原图像)根据 background-position 属性的值放置。
默认值:	none
继承性:	no
版本:	CSS1
JavaScript 语法:	object.style.backgroundImage="url(stars.gif)"

可能的值

值	描述
url('URL')	指向图像的路径。
none	默认值。不显示背景图像。
inherit	规定应该从父元素继承 background-image 属性的设置。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant