zoukankan      html  css  js  c++  java
  • css怎么设置图片平铺方式?

    background-repeat属性是用来设置背景图像如何平铺的。默认地,背景图像在水平和垂直方向上重复。

    属性值:

    • repeat:即默认方式,完全平铺背景;

    • no-repeat:在X及Y轴方向均不平铺;

    • repeat-x:横向平铺背景;

    • repeat-y:纵向平铺背景。

    提示:背景图像的位置是根据 background-position 属性设置的。如果未规定 background-position 属性,图像会被放置在元素的左上角。

    css背景图片平铺之完全平铺背景的代码:

    <!DOCTYPE html>
    <html>
    <head>
    <style type="text/css">
    div{
    margin: 20px;
    }
    .content1 {
    border: 1px solid #000fff;
    height: 200px;
    background-image: url(../2018.12.15/2.jpg);
    background-repeat: repeat;
    }
    .content2 {
    border: 1px solid #000fff;
    height: 200px;
    background-image: url(../2018.12.15/2.jpg);
    background-repeat: repeat-x;
    }
    .content3 {
    border: 1px solid #000fff;
    height: 200px;
    background-image: url(../2018.12.15/2.jpg);
    background-repeat: repeat-y;
    }
    .content4 {
    border: 1px solid #000fff;
    height: 200px;
    background-image: url(../2018.12.15/2.jpg);
    background-repeat: no-repeat;
    }
    </style>
    <div class="content1"></div>
    <div class="content2"></div>
    <div class="content3"></div>
    <div class="content4"></div>
    </body>

    </html>

    广州vi设计公司 http://www.maiqicn.com 我的007办公资源网 https://www.wode007.com

  • 相关阅读:
    软件项目“免坑”指南
    软件项目质量保证——编码规范
    从Web借鉴UI设计
    C#学习笔记——面向对象、面向组件以及类型基础
    关系数据库设计
    Winform开发框架之插件化应用框架实现
    桌面程序界面设计分享
    2-Bom
    1-简介
    测试
  • 原文地址:https://www.cnblogs.com/xiaonian8/p/13663732.html
Copyright © 2011-2022 走看看