1.css
<style type="text/css">
#div1 {
height:330px;
background-color:rgba(0, 0, 0, 0.3);
}
</style>
2.html
<body style="background-image: url('/img/1.jpg');">
<div id="div1" style="margin-top: 10%;width: 30%;margin-left: 35%;">
<div class="row">
<div class="col-sm-6 col-sm-offset-3 form-box">
<div class="form-top" style="margin-top: 30px;">
<div class="form-top-left">
<h3 style="color: white;">XXXX</h3>
<br/>
</div>
</div>
<div class="form-bottom contact-form">
<div class="form-group">
<input type="text" placeholder="用户名..." class="form-control" id="name">
</div>
<div class="form-group">
<input type="text" placeholder="密码..." class="form-control" id="pwd">
</div>
<button type="submit" class="btn">登录</button>
</div>
</div>
</div>
</div>
</body>