Html 如何在div中间获取文本?
为什么页脚中的文本在div中不会处于中间高度?没有人解释如何正确地让文本坐在中间(高度明智)的div,希望这也将修复白色的间距在底部的页面,因为我相信这是由于文本被推下< /p> HTMLHtml 如何在div中间获取文本?,html,css,Html,Css,为什么页脚中的文本在div中不会处于中间高度?没有人解释如何正确地让文本坐在中间(高度明智)的div,希望这也将修复白色的间距在底部的页面,因为我相信这是由于文本被推下< /p> HTML <div class="yellowfooterbackground"> <div class="yellowfootercontent"> <div class="yellowfootercontentleft"> <
<div class="yellowfooterbackground">
<div class="yellowfootercontent">
<div class="yellowfootercontentleft">
<p>IPS Fire & Security is a trading name of IPS Facilities - <u><a href="Terms-And-Conditions.html">Terms & Conditions</a></u></p>
</div>
<div class="yellowfootercontentright">
<p> Web Design & SEO by Raven </p>
</div>
</div>
</div>
下面是上面的一些代码:您可以使用线条高度:
.yellowfootercontent {
height: 30px;
width: 950px;
margin-right: auto;
margin-left: auto;
font-family: 'Open Sans', Arial, sans-serif;
font-size: 12px;
line-height: 5px;
}
参考资料
试试这个
.yellowfootercontentright {
height: auto;
width: 475px;
margin-right: 20%;
margin-left: 20%;
line-height: 4px;
}
行高将解决高度问题。.yellowfottercontent,文本对齐您已应用为“左””,它应居中以使文本居中
.yellowfootercontentleft {
height: 30px;
width: 475px;
float: left;
text-align: center;
}
还有一件事,这也取决于你给div的高度,比如检查一下这个小提琴
这里的高度是50px,边距是10px,也就是说,边距周围有10px的空间,这有助于文本成为div的中心
让我知道检查此链接:
.yellowfootercontentleft {
height: 30px;
width: 475px;
float: left;
text-align: center;
}