gpt4 book ai didi

html - 页脚文本和垂直对齐问题

转载 作者:搜寻专家 更新时间:2023-10-31 08:33:46 25 4
gpt4 key购买 nike

我试图让我的页脚文本在我的页脚 DIV 中垂直对齐,但这不起作用。我尝试了 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;
}

最佳答案

我会对您的 CSS 进行以下调整:

.footer {
height: 50px;
line-height: 50px;
vertical-align: middle;
}

.footer p.left {
xxvertical-align: middle;
xxline-height: 1;
}
.footer p.right {
xxvertical-align: middle;
xxline-height: 1;
}

在您的 .footer 中将 heightline-height 声明为某个固定值。删除 p.leftp.right 中的这两个属性。

只要您有单行内容,这应该没问题。

fiddle :http://jsfiddle.net/audetwebdesign/hqdP2/4/

关于html - 页脚文本和垂直对齐问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16470382/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com