zoukankan      html  css  js  c++  java
  • CSS 背景

    <style>
    h1
    {
        background-color:#6495ed;
    }
    p
    {
        background-color:#e0ffff;
    }
    div
    {
        background-color:#b0c4de;
    }
    </style>

    背景颜色和图片插入

    <style>
    body 
    {
        background-image:url('paper.gif');
        background-color:#cccccc;
    }
    </style>
    
    <style>
    body
    {
             background-coolor:rgb(222,222,222);
    }

    直接铺

    <style>
    body
    {
        background-image:url('gradient2.png');
    }
    </style>

    水平铺

    <style>
    body
    {
        background-image:url('gradient2.png');
        background-repeat:repeat-x;
    }
    </style>

    设置定位+不平铺

    <style>
    body
    {
        background-image:url('img_tree.png');
        background-repeat:no-repeat;
    }
    </style>

    背景图片不重复,设置 position 实例。

    背景图片只显示一次,并与文本分开。

    实例中还添加了 margin-right 属性用于让文本与图片间隔开。

    <style>
    body
    {
        background-image:url('img_tree.png');
        background-repeat:no-repeat;
        background-position:right top;
        margin-right:200px;
    }
    </style>
  • 相关阅读:
    WebGL_0008:支持移动端的控制台调试工具
    调整两数组元素使得两数组差值最小
    集五福
    打印机顺序打印
    子弹分发
    字符串分割
    乐观锁、悲观锁
    字符串去重
    数组最后剩下的数字
    shell常用工具
  • 原文地址:https://www.cnblogs.com/claudia529/p/11519134.html
Copyright © 2011-2022 走看看