CSS背景

背景样式

  • 背景颜色: background-color :
  • 背景图片: background-image:url();
  • 设置背景图片的位置:background-position:top / left / right / bottom / center 在两个方位设置以上偏移值,缺省则默认缺省所在方位伪center
  • 背景重复方式:background-repeat:no-repeat / repeat-x / repeat-y
  • 设置背景的范围
    • background-clip:边框出现的位置 border-box 出现在边框下方/ padding-box / content-box
    • background-origin:边框偏移的参考 border-box / padding-box / content-box
  • 设置背景的大小:backgound-size : 宽度px 高度px / cover 将元素铺满 / contain 以原图大小显示
  • 可将上述样式通过background写入一行:需注意 background-position/background-size background-origin background-clip 这四个的顺序和书写
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值