zoukankan      html  css  js  c++  java
  • html5中 背景自适应

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>css实现背景图片自适应大小</title>
    </head> 
    <body>
    <html>
    <style>
        body{
            margin:0px;
            padding: 0px;
            width: 100%;
            height: 100%;
        }
        #bg_bg{
            width: 100%;
            height: 100%;
            border : 0px red solid;
            background-image: url('https://ss0.baidu.com/-Po3dSag_xI4khGko9WTAnF6hhy/super/whfpf%3D68%2C40%2C50/sign=816023f01a178a82ce692ce0903e45b5/5bafa40f4bfbfbeda822ef437cf0f736afc31f96.jpg');
            background-repeat: no-repeat;
            background-size: 100% 100%;
        }
    </style>
    <body>
        <div id="bg_bg">
        </div>
    </body>
    </body>
    </html> 
    <script>
        document.getElementById('bg_bg').style.height=document.body.scrollHeight+"px";
    </script>
  • 相关阅读:
    ELASTIC 动态修改配置API
    ELASTIC API
    ELASTIC索引监控脚本
    java并发多线程纪要
    Git 基础
    Linux 权限规划ACL
    Linux账号管理(二)
    Linux账号管理(一)
    Linux 备份工具dump
    Linux 文件压缩、打包
  • 原文地址:https://www.cnblogs.com/yudishow/p/4260466.html
Copyright © 2011-2022 走看看