Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexbox full page body and html with sticky header and footer #183

Open
mhulse opened this issue Jul 9, 2018 · 0 comments
Open

Flexbox full page body and html with sticky header and footer #183

mhulse opened this issue Jul 9, 2018 · 0 comments

Comments

@mhulse
Copy link
Owner

mhulse commented Jul 9, 2018

<body class="container">
  <header></header>
  <main class="content"></main>
  <footer></footer>
</body>
.container {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}
.content {
  flex: 1;
}

I tend to not put flexbox on the body as I usually have non-flexbox immediate children elements. In this case, you could experiment with:

body {
     height: 100vh;
}

… and apply .container to a child div of the body element.

WARNING: iOS may have issues with 100vh; test thoroughly.

@mhulse mhulse changed the title Flexbox full page body and html Flexbox full page body and html with sticky header and footer Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant