方式一
<div class="content">
    <div class="bg_img">
        <img src="../../img/bg.png" />
    </div>
</div>
.content {
    position: fixed;  //关键是设置fixed定位,设置后即可通过height:100%设置标签高度为页面高度,无需js,神奇吧
    width: 100%;
    height: 100%;
    .bg_img {
        width: 100%;
        height: 100%;
        img{
            width: 100%;
            height:100%;
            background: url("../../assets/img/loginbg.jpg") no-repeat center;
            background-size: 100% 100%;  
            overflow: hidden;  //所需要设置内容区域滚动,则设置overflow:auto
        }
    }
}
方式二
<div class="content">
        <img class="bg_img" src="../../img/bg.png" />
</div>
.content {
    .bg_img{
        position: fixed;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        z-index: -1;
    }
}