【问题标题】:How set header under the footer in media queries如何在媒体查询的页脚下设置页眉
【发布时间】:2017-12-01 04:15:41
【问题描述】:

我有页眉、一些部分和页脚。当我在电话媒体查询中(0 到 480 像素)时,我想将页眉的位置更改为在我的页脚下。可能吗?

【问题讨论】:

标签: html css flexbox media-queries


【解决方案1】:

您可以在父级上使用display: flex; flex-direction: column;,然后使用order 属性在媒体查询中重新组织。

body {
  display: flex;
  flex-direction: column;
}

@media (max-width: 480px) {
  header {
    order: 1;
  }
}
<header>header</header>
<section>section</section>
<section>section</section>
<section>section</section>
<footer>footer</footer>

【讨论】:

  • 正是我需要的!非常感谢。
猜你喜欢
  • 2012-03-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-08-08
  • 1970-01-01
  • 2019-02-15
相关资源
最近更新 更多