背景相关属性

来源:互联网 发布:试述数据库设计的步骤 编辑:程序博客网 时间:2024/06/05 10:41

background-color:背景色

background-image:设定背景图片,需要设置图片的url地址

background-repeat:图片的复制选项

repeat:在水平和垂直两个方向上进行复制

no-repeat:不复制

repeat-x:在水平方向上复制

repeat-y:在垂直方向上复制

也可以将这一组属性值封装到一个属性background中,书写书序是:

背景色background-color

背景图片background-image

重复方式background-repeat

位置backgroud-position

表达更加简洁

background:green url("../pic/js.jpg")no-repeat right top;