背景

<!-- 
    background:;    简写形式

    1:背景色
        background-color:;

    2:背景图:
        background-image:url(图片的路径);
        a:背景图的显示形式:
            容器大于背景图的时候,直到铺满为止
            容器等于背景图的时候,正好显示一张
            容器小于背景图的时候,只显示容器区域
            
            注:背景图是不占据空间的。

    3:控制背景图是否平铺
        background-repeat: ;
            属性值:
                repeat  平铺
                no-repeat   不平铺
                repeat-x    横向平铺
                repeat-y    纵向平铺

    4:控制背景图的位置:
        background-position:;
            属性值为两个:
                第一个控制左右
                第二个控制上下
                center  左右上下居中
                left    center  在左侧 处于上下居中

    5:背景图的固定:
        bckground-attachment:;
            属性值:
                scroll(滚动)
                fixed(固定)

    6;简写形式:
        background:颜色值 url() no-repeat right center;

 -->
posted on 2021-01-07 15:17  sunandwang  阅读(97)  评论(0)    收藏  举报