CSS Background

作者: roy_pub | 来源:发表于2018-11-30 23:11 被阅读5次

background-color

    background-color: cyan;
    background-color: rgba(0,0,0,0.5);

background-image

    background-image: url("images/car.jpg");

background-repeat

    background-repeat: no-repeat;
属性 说明
repeat 背景图片纵向和横向平铺
no-repeat 背景图片不平铺
repeat-x 背景图片在横向上平铺
repeat-y 背景图片在纵向上平铺

background-position

设置或检索对象的背景图像位置,必须先指定 background-image 属性,默认值(0%, 0%)
如果只指定了一个值,该值用于横坐标,纵坐标默认为50%,第二个值用于纵坐标
该属性定位不受对象的属性(padding)设置影响

  • background-position: length || length
  • background-position: position || position
  • length: 百分数,由浮点数字和单位标识符组成的长度值
  • position: top | center | bottom | left | right
    background-position: center top;
    background-position: center center;
    background-position: right bottom;
    background-position: left;
    background-position: 12px 50px;
    background-position: 10px center;
    background-position: 10px;

background-attachment

  • scroll:背景图片随内容滚动
  • fixed:背景图片固定

background

background:背景颜色 背景图片地址 背景平铺 背景滚动 背景位置

    background: transparent url("car.jpg") repeat-y scroll 50% 0;

相关文章

  • 关于背景

    background:1、css2:background:background-color || url("") ...

  • CSS3 背景

    CSS3 背景 CSS3 background-origin 属性 background-origin 属性规定背...

  • CSS背景图

    css背景图 涉及的css属性 background-image background-repeat 默认情况下,...

  • Tailwind Background

    背景滚动(background attachment) CSS提供的background-attachment属性...

  • CSS3-background扩展属性

    CSS3对background新加了3个属性,background-origin、background-clip、...

  • css:background

    1.背景图片的平铺 background-repeat:repeat,repeat-y,repeat-x,no-r...

  • CSS—background

    css允许使用纯色作为背景,同样也允许使用图片作为背景。关于背景的设置: background-colorback...

  • CSS -- background

    background 属性用来设置元素的背景 CSS1 中的background属性链接: background-...

  • CSS Background

    background-color background-image background-repeat backg...

  • css background

    css background(背景)属性有8个,但是工作中并没有把每个都用起来,有些甚至不知道是什么作用,这不太好...

网友评论

    本文标题:CSS Background

    本文链接:https://www.haomeiwen.com/subject/iqqwqqtx.html