Skip to content

Commit

Permalink
Stick footer to bottom of page
Browse files Browse the repository at this point in the history
Used flexbox strategy outlined here
https://css-tricks.com/couple-takes-sticky-footer/
  • Loading branch information
hackartisan committed Oct 9, 2023
1 parent fe84651 commit 728e7d9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,28 @@
*= require_tree .
*= require_self
*/

html, body, div.lux {
height: 100%;
}

body {
margin: 0;
}

/* wraps main content to make lux work */
/* styled to ensure sticky footer */
div.lux {
display: flex;
flex-direction: column;
}

.homepage-img {
margin-top: 1em;
}

#main-content {
flex: 1 0 auto; /* part of the sticky footer setup */
margin: 20px 20px;
/* ensure content stays within boundaries of header / footer, which have
* default max-width of 1170, see
Expand All @@ -27,6 +44,10 @@ body {
padding: 0 calc(calc(calc(100% - 1170px) / 2));
}

.lux-library-footer {
flex-shrink: 0; /* part of sticky footer */
}

#list_header {
color: orange
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/welcome/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<td>
<%= image_tag("cardcatalog.gif", alt: "card catalog image") %>
<%= image_tag("cardcatalog.gif", class: "homepage-img", alt: "card catalog image") %>
<td>

<p>This dictionary catalog contains records for items cataloged before 1980.</p>
Expand Down

0 comments on commit 728e7d9

Please sign in to comment.