我想我的中心DIV「聯繫箱」水平和垂直內格「接觸美國」。它水平但不垂直,任何想法爲什麼? TKS
HTML
<div id="contact-us">
<div id="contact-box">
<p><b>Company Name</b></p>
<p>Company street</p>
<p>Company city</p>
<p>Company country</p><br />
<a href="#inline" class="modalbox">Contact Us</a>
<img src="images/email-icon.png" alt="Picture" /></div>
</div>
CSS
#contact-us {
height: 1300px;
background: #8aba56;
padding-top: 250px;
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;
display:block;
vertical-align:middle;
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 solid #efefef;
background: #fff;
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
}
你可以發佈你申請的CSS的HTML和的jsfiddle是可能的嗎? – j08691 2012-08-04 15:19:08
@AnkitGautam在CSS中,它似乎足夠必要或不夠直觀,人們總是想問這個問題。 – 2012-08-04 15:31:43
剛剛編輯我的帖子來添加html – Greg 2012-08-04 15:36:40