Skip to content

Instantly share code, notes, and snippets.

@fhefh2015
Created May 11, 2016 02:47
Show Gist options
  • Save fhefh2015/2d27db5e02fbaa81a7ccc1e3571e794e to your computer and use it in GitHub Desktop.
Save fhefh2015/2d27db5e02fbaa81a7ccc1e3571e794e to your computer and use it in GitHub Desktop.
css3方法:未知高度宽度居中
<style>
.tips_layer_wrap {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, .7);
z-index: 10000;
}
.tips_layer_wrap .tips_layer {
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
padding: 46px 60px;
background: #fff;
position: absolute;
left: 50%;
top: 50%;
font-size: 20px;
color: #000;
border-radius: 10px;
}
</style>
<div class="tips_layer_wrap">
<div class="tips_layer">请填写完整信息</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment