pop-box-0

弹出窗垂直水平居中

by lv san

HTML

<div class="box-default box-wh box-vc-mar">this is a pop-up box</div>

CSS

body {
			height: 1000px;
		}

		.box-default {
			position: fixed;
			top: 50%;
			left: 50%;
			z-index: 99;
			padding: 20px;
			background-color: white;
			border: 1px solid #ccc;
			border-radius: 8px;
		}

		.box-wh {
			width: 200px;
			height: 200px;
		}

		.box-vc-mar {
			margin-left: -100px;
			margin-top: -100px;
		}