<style type="text/css">
*{margin: 0;padding: 0}
html,body{height: 100%} /*这里很关键*/
.outer-wrap{
/*只有同时为html和body设置height: 100%时,这里的height才生效,
并且随浏览器窗口变化始终保持和浏览器视窗等高*/
height: 100%;
position: relative;
background-color: rgba(0, 0, 0, .5);
}
.login-panel{
width: 400px;
height: 300px;
background-color: orange;
position: absolute;
top: 50%;
left: 50%;
margin-top: -150px;
margin-left: -200px;
}
</style>
登入框居中css
猜你喜欢
转载自blog.csdn.net/weixin_38331049/article/details/104940263
今日推荐
周排行