css - 你如何在最后一个 'div' 中设置最后一个 'div' flexbox?

标签 css flexbox

如何随着分页元素数量的变化将最后一个“div”设置在另一个“div”中?我有 12 个元素。 在分页期间,当我在第一页时,我已将元素数设置为例如 5。转到第二页我有 5 个元素。转到第三页,我有两个元素,这是问题所在,因为

<div class =" pagination ">
    <ul uib-pagination>
    </ Ul>
</ div> 

向上移动,我希望他留在向下的同一个地方<div class='Section'>

    .artistsSection {
      height: 100%; 
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      text-align: center;
      align-items: center;
    }


    .pagination {
      margin: 0;
      padding: 10px;
      font-size: 10px;
      display: flex;
      align-self: flex-end;
    }
 <div class='Section'>
        <h1>List </h1>

        <div class="form-group">
            <input />
        </div>

        <pre class="currentPage"></pre>
        <section class='todos'>
            <ul>
                <li >
                    <a></a>
                </li>
            </ul>
        </section>

        <div class="pagination">
            <ul uib-pagination>
       
            </ul>
        </div>
   </div>

我想使用 flexbox。

最佳答案

align-self 在主轴上没有等效项(如 justify-self)。

相反,您可以执行以下操作:

.Section {
  height: 100%; 
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
}


.pagination {
  margin: 0;
  padding: 10px;
  font-size: 10px;
  display: flex;
  margin-top: auto;
}

关于css - 你如何在最后一个 'div' 中设置最后一个 'div' flexbox?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56246383/

相关文章:

html - flexbox 中最小尺寸的内容

html - 如何在不编辑我的 html 的情况下制作下拉菜单

html - h1 和 span 元素的奇怪尺寸问题

html - 如何在容器中间使用倾斜属性到顶部和底部

css - 水平 flex 盒( Accordion )中的内容溢出

html - 只模糊背景中的重复图像?

html - 为什么3个span4 bootstrap div将第三个推到一个新行

CSS Flex 导航栏 - 如何?

html - Flexbox 子项在 Safari 中超出其高度

javascript - 如何在点击汉堡包时显示导航