29Sticking a Footer to a Window

Sticky footers are, as the name suggests, footers that stick to the bottom of your browser. They’re such a hassle to design in CSS. But in Compass there’s a built-in mixin that allows you to make a sticky footer very simply.[12] All you need to define is the height (measured from the bottom of the page) at which the sticky footer floats.

There are three predefined selectors that we apply in this mixin: root, root_footer, and footer. We chose these three because they’ve already been built into Compass. You can see how we use them on the opposite page.

But hey, if you desperately want to use your own selector names, you can! For example, you can change the first ID, root, to a_root in the HTML. In your style sheet, ...

Get Pragmatic Guide to Sass now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.