[css]全屏背景图片设置,django加载图片路径

做~自己de王妃 提交于 2019-12-29 08:24:09
<head><style type="text/css">
    #bg {
        position:fixed; 
        top:0; 
        left:0; 
        width:100%; 
        height:100%;
    }

    #bg img {
        position:absolute; 
        left:0; 
        right:0; 
        bottom:0; 
        margin:auto; 
        width:100%;
        height:100%;
        z-index:-1;
    }
    </style>
</head>
<body>
    <div class="container">
      <div id="bg">
        <img src="{% static 'img/login.jpg' %}" alt="">
      </div>
      <div>      
                    添加内容,该内容不会被遮挡,分割  
       </div></body>

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!