javascript - Centering Footer Content
问题描述
I'm having trouble centering vertically the contents of my footer in the footer tag. I've tried setting the footer content margin-top
. Display, Position the issue persists. I'm not sure what I've been doing wrong. If anyone could help me I would greatly appreciate it. Thanks!
Example of Issue on my Index.html
Update what I want it to look like
footer {
background-repeat: no-repeat;
background-color: #1F1E1E;
height: 50%;
font-family: 'Open Sans', sans-serif;
}
.footercontent {
display: flex;
vertical-align: center;
justify-content: center;
align-items: flex-start;
}
.footerlogo {
font-size: 15px;
}
.footerlogo img{
height: 70px;
}
footer img{
height: 60px;
}
footer a {
color: white;
}
footer a:hover {
color: #8FBAFF;
}
footer ul {
color: white;
text-align: left;
}
.caption {
margin-top: 10px;
}
.space {
margin-top: 30px;
}
.bold {
font-size: 15px;
font-weight: bold;
line-height: 35px;
}
<footer class="footer">
<div class="footercontent">
<div class="footerlogo col-md-3 footernone">
<img src="img/motivel.png">
<div class="space">
<p><a href="">phone#</a></p>
<p><a href="">emailadress</a> </p>
</div>
</div>
<div class="col-md-2 footerm">
<ul class="bold">Explore</ul>
<ul><a>Home</a></ul>
<ul><a>About</a></ul>
<ul><a>Services</a></ul>
<ul><a>Contact</a></ul>
</div>
<!--
<div class="col-md-2 footernone">
<ul class="bold">Follow</ul>
<ul><a>Facebook</a></ul>
<ul><a>Instagram</a></ul>
<ul><a>Twitter</a></ul>
<ul><a>Behance</a></ul>
</div>
-->
<div class="col-md-2 footernone">
<ul class="bold">Legal</ul>
<ul><a>Terms</a></ul>
<ul><a>Privacy</a></ul>
</div>
</div>
</footer>
解决方案
我不知道这是不是你的意思。但是,如果您想将项目居中垂直居中,您可以在 .footercontent中更改align-items: flex-start
为align-items: center
推荐阅读
- prolog - 如何为此查询绘制 SLD 树
- javascript - url 在浏览器中有效,但在函数中不返回任何内容
- python - 如何在 Pandas 中跨不同数据帧执行 Groupby、Rank 和 Sum 计算
- python - 堆叠numpy数组A对应于数组B
- python - 删除 Anaconda 包失败(InvalidArchiveError)
- java - 在 android 的聊天应用程序中创建文本气泡的更好选择?
- symfony - Sylius 订单更新并发问题
- c# - 我如何知道我的串行通讯是否被 GC 关闭?
- amazon-web-services - 具有持久会话的 AWS IOT MQTT - 订阅失败
- .net-core - Entity Framework Core:如何返回可查询的
与“使用”?