html中的背景

背景颜色  background-color:red;

背景图片  background-image:url(img/bg.jpg);

背景图是否重复  background-repeat:no-repeat;      /repeat; /repeat-x;

背景图的位置  background-position:center 0px;     /第二个值不写默认居中   /left 、right、top、bottom 、center

背景图是否滚动  background-attachment:fixed;

复合样式--不分顺序(颜色 图片 是否重复 位置 是否滚动)例如:

background:red url(img/bg/jpg) no-repeat center top scroll;

posted @ 2018-10-17 16:09  yyyangel  阅读(266)  评论(0编辑  收藏  举报