html背景图片在底部,CSS兑现固定DIV层背景图片且底部显示

痛定思痛。 2022-10-06 07:57 73阅读 0赞

CSS实现固定DIV层背景图片且底部显示

/*CSS缩写形式*/

div {

background:url(/images/about_bg.jpg) no-repeat fixed;

background-position-y:bottom;

}

/*CSS代码详解*/

div {

background-image:url(/images/bg.jpg);  /*自行修改背景图片路径*/

background-repeat:no-repeat;  /*背景图片不重复显示*/

background-repeat:repeat;  /*背景图片横向及纵向重复*/

background-repeat:repeat-x;  /*背景图片横向重复*/

background-repeat:repeat-y;  /*背景图片纵向重复*/

background-attachment:fixed;  /*固定背景图片*/

background-attachment:scroll;  /*滚动背景图片*/

background-position-x:left;  /*背景图片在横向的最左方显示*/

background-position-x:right;  /*背景图片在横向的最右方显示*/

background-position-y:top;  /*背景图片在纵向的最上方显示*/

background-position-y:bottom;  /*背景图片在纵向的最下方显示*/

}

发表评论

表情:
评论列表 (有 0 条评论,73人围观)

还没有评论,来说两句吧...

相关阅读

    相关 CSS背景图片无法显示

    问题描述: 我在编写网页时,设置了CSS样式来指定背景图片,但是在浏览器中预览时,背景图片却无法显示出来。请问我应该如何解决这个问题呢? 解决方案: 1. 检查图片路