我试图让页脚文本在页脚DIV内垂直居中,但这并不起作用。我尝试了
CSS(层叠样式表):
vertical-align: middle
,但没有成功。问题出在哪里?非常感谢。
JSfiddle:http://jsfiddle.net/Grek/hqdP2/
<div class="menu">
<div class="inner"> <a href="www.dfdsfdsfs.com/index.html" class="logo">Gregory</a>
<ul>
<li > <a href="www.dfdsfdsfs.com">Category 1</a> </li>
<li > <a href="www.dfdsfdsfs.com">Category 2</a> </li>
<li > <a href="www.dfdsfdsfs.com">Category 3</a> </li>
<li > <a href="www.dfdsfdsfs.com">Category 4</a> </li>
<li > <a href="www.dfdsfdsfs.com">Category 5</a> </li>
<li class="selected"> <a href="www.dfdsfdsfs.com/">Category 6</a> </li>
<li > <a href="www.dfdsfdsfs.com">Contact</a> <span class="pipe"></span> </li>
</ul>
<div class="social">
<div class="fb-like" data-href="http://www.123.com" data-send="false" data-layout="button_count" data-width="450" data-show-faces="false"></div>
</div>
</div>
</div>
<div id="quote">
<blockquote>
<p>"Nos soutenons depuis la début"</p>
<cite>Innovation</cite> </blockquote>
<blockquote>
<p>"L'exceptionnelle"</p>
<cite>Hydro-geologiste</cite> </blockquote>
</div>
<div class="article content">
<h1>Biography</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<a class="image-popup-vertical-fit" href="http://farm9.staticflickr.com/8241/8589392310_7b6127e243_b.jpg" title="Caption. Can be aligned it to any side.">
<img src="http://farm9.staticflickr.com/8241/8589392310_7b6127e243_s.jpg" width="75" height="75">
</a><h2>Sub-title</h2><p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>
<p><strong>LOREM IPSUM</strong></p>
<h3>Tel. +123 456.789 - E-mail: contact@kjhhklh.com</h3>
</div>
</div>
<div class="footer">
<p class="left">contact@mydomain.com | + 12 345.678.910</p>
<p class="right">contact@mydomain.com | + 12 345.678.910</p>
</div>
</body>
</html>
CSS(层叠样式表):
/* Footer
/* -------------------------------------------- */
.footer {
position: fixed;
z-index: 300;
bottom: 0;
width: 100%;
min-width: 768px;
max-width: 1950px;
margin: 0 auto;
background: #2b2b2b;
}
.footer a {
color: #fff;
text-transform: uppercase;
border-bottom-color: #2b2b2b;
}
.footer a:hover {
border-bottom-color: #ECB825;
}
.footer p.left {
display: inline-block;
float: left;
color: #fff;
padding-left: 20px;
vertical-align: middle;
font-family: 'Futura W01 Heavy', Arial, sans-serif;
font-size: 10px;
line-height: 1;
letter-spacing: 0.10em;
text-transform: uppercase;
padding-bottom: 1px;
}
.footer p.right {
display: inline-block;
float: right;
padding-right: 20px;
color: #fff;
padding-left: 20px;
vertical-align: middle;
font-family: 'Futura W01 Heavy', Arial, sans-serif;
font-size: 10px;
line-height: 1;
letter-spacing: 0.10em;
text-transform: uppercase;
padding-bottom: 1px;
}