javascript - 居中页脚内容

标签 javascript html css

我在将页脚标记中的页脚内容垂直居中时遇到问题。我试过设置页脚内容 margin-top。显示、定位问题依旧。我不确定我做错了什么。如果有人可以帮助我,我将不胜感激。谢谢!

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

关于javascript - 居中页脚内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52920784/

相关文章:

javascript - 如何使用正则表达式和 jQuery 将两个单独的字符串替换为两个单独的替换字符串?

php - SQL打印表不起作用

javascript - 如何让多个输入使用按键功能? JavaScript HTML

html - <button class ="button"> 标签 vs <div class ="button">

javascript - jQuery 选项卡和 shift+tab 显示导航

html - Bootstrap - 网格系统 - 修复了高度问题

javascript - 带有 Angular js + Bootstrap 的响应式菜单(移动设备)无法按预期工作

javascript - .load 和 .getScript 之后的 jQuery 绑定(bind)仅在警报之后有效

javascript - 如果字符串同时包含数字和字母,如何按字母顺序对字符串进行排序?

javascript - 在 PHP 中使用 Jquery Datepicker 显示日期时出错