61,112
社区成员
发帖
与我相关
我的任务
分享
background-image:url('xx.png');
background-size:cover;
filter : progid:DXImageTransform.Microsoft.AlphaImageLoader ( sizingMethod='scale' , src='xx.png')
<style type="text/css">
html,body{margin:0;padding:0;width:100%;height:100%;}
body{background:url("http://b.zol-img.com.cn/desk/bizhi/image/5/960x600/1409882801492.jpg");background-size:cover;background-repeat:no-repeat;background-position:center;}
.login-box{position:fixed;width:200px;height:200px;background:rgba(0,0,0,0.5);left:50%;top:50%;margin-left:-100px;margin-top:-100px;}
</style>
<div class="login-box"></div>
自己去调:
background-position:center;可以改为 background-position:20% 40%;
left:50%;top:50%; 可以改为:left:20%;top:40%;