在我的网站http://goo.gl/16XdA页面“联系我们”上,我希望联系人框在容器 div“联系我们”中垂直对齐。问题在于,使用当前代码,联系人框在“联系我们”div 的 1400 像素高度的中间对齐。无论屏幕分辨率是多少,有没有办法将联系人框对齐到屏幕中间?(或为contact-us div设置100%的高度,但这不起作用)
#contact-us {
height: 1400px;
background: #8aba56;
padding-top: 250px;
position: relative;
background: url(../images/bg-water13.jpg) no-repeat center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}
#contact-box {
text-align:center;
font: 12px 'Open Sans', "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 400;
width: 300px;
Height:120px;
padding:15px;
/*margin-left: auto;
margin-right: auto;*/
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)";
filter: alpha(opacity=95);
opacity: 0.85; /* For IE8 and earlier */
border: 1px dotted #666;
background: #fff;
position: absolute;
top: 50%;
left: 50%;
margin-top: -60px;
margin-left: -150px;
}