• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
james1207

博客园    首页    新随笔    联系   管理    订阅  订阅

在div 底部显示背景图片

下面代码实现div层背景图片在底部显示:
div {
background : url (/images/bg.jpg) no-repeat fixed ;
background-position-y: bottom ;
}
代码详解:
div {
background-image : url (/images/bg.jpg); /*设置div层的背景图片*/
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 ; /*背景图片在纵向的最下方显示*/
}
posted @ 2013-08-14 18:43  Class Xman  阅读(630)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3