zoukankan      html  css  js  c++  java
  • 背景样式

    背景样式
    设置全屏背景
    背景颜色:<body bgcolor="red"></body>
    背景图片:<body background="lq.jpg"></body>
    如果图片大小不合适,则画面显示存在问题
    背景样式:
    600px;
    height: 768px;
    background-image: url("lq.jpg");
    background-repeat: no-repeat;/*过小时不重复*/
    background-position: 25px 50px/*距离左边界25,上边界50*/;
    background-attachment: scroll; 设置依附方式
    background-repeat: xx;
    repeat:横纵向都重复
    repeat-x:横向重复
    repeat-y:纵向重复
    background-attachment:xx;
    fixed:背景图不随滚动条变化而变化
    scroll:随滚动条一起变化而变化
    也可通过:
    background:lq.jpg no-repeat scroll 25px 50px
    背景全屏设置,不重复
    #d2{
    700px;
    height: 800px;
    background-image: url("lq.jpg");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-attachment: scroll;

    }
    百分比设置
    可以让其适应不同的设备
    首先必须要保证父元素已经设置了尺寸
    <style>
    html,body{
    100%;
    height: 100%;
    }
    #p1{
    50%;
    height: 50%;
    background: gold;
    }

    </style>

  • 相关阅读:
    linux 下安装web开发环境
    js 字符串的操作
    css 弹出层-透明层
    Nginx服务器 之反向代理与负载均衡
    html5 响应式布局
    css 文本溢出显示省略号
    栈的运用(6)
    ctypes to load library in c/c++
    Expert Python programming
    Python type class metaclass
  • 原文地址:https://www.cnblogs.com/longmo666/p/13554397.html
Copyright © 2011-2022 走看看