pop-box-2

实现一个不定宽高的弹出窗(css3 transform)

by lv san

HTML

<div class="box-default box-vc-trf">this is a pop-up box that only html+css</div>

CSS

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

	.box-vc-trf {
		-webkit-transform: translate(-50%, -50%);
		-ms-transform: translate(-50%, -50%);
		-o-transform: translate(-50%, -50%);
		transform: translate(-50%, -50%);
	}