Guest User

Untitled

a guest
Nov 19th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. /** STICKY-FOOTER CSS
  2. * these styles configure a "sticky" footer
  3. *
  4. * "sticky" footers stick to the bottom of the window
  5. * when there isn't much page content,
  6. * but stick to the bottom of the page
  7. * when the content is bigger than the window.
  8. *
  9. * traditional "sticky" footers use padding or calc()
  10. * which require knowledge of the heights of the
  11. * header and footers.
  12. * this isn't ideal, as responsive sites will usually
  13. * change the heights of these elements
  14. *
  15. * modern "sticky" footers use flex or grid
  16. * to circumvent this issue.
  17. * these solutions have poor support in IE.
  18. *
  19. * this solution uses flex, but has full support
  20. * for IE10 and IE11.
  21. **/
  22.  
  23. /* RESET */
  24. body {
  25. margin: 0;
  26. }
  27.  
  28. /* "sticky" footer */
  29. html {
  30. height: 100%;
  31. }
  32. body {
  33. display: flex;
  34. flex-direction: column;
  35. height: 100vh; /* avoids IE 10-11 `min-height` bug */
  36. }
  37. main {
  38. flex: 1 0 auto;
  39. }
  40. header, footer {
  41. flex-shrink: 0;
  42. }
  43.  
  44. /* visuals */
  45. header {
  46. background-color: #FF5722;
  47. }
  48. footer {
  49. background-color: #00BCD4;
  50. }
  51. header, main, footer {
  52. padding: 2em;
  53. }
Add Comment
Please, Sign In to add comment