Fluid Headers & Footers in Headway 3.0
So-called “fluid” headers and footers are quite the rage in web development, aren’t they? So pretty, So shiny, So, so fluid. You want it, and I can’t blame you. I want it too.
A future version of Headway will include the ability to create a fluid header and footer more easily without any custom code, but until then, this tutorial should suit. Let’s get on the same page about what we’re talking about: A fluid header and footer, as it’s often defined, really refer to anything where the header and/or footer area appear to fill the entire screen – no matter the width – while the page and header content (logos, phone numbers, etc) actually stay centered on the page. This is different than a strong trend in web design now called responsive design. You can see examples of fluid header and footer on this site, and at BBC News, WordPress.org, and WPTuts+.
Fluid Header
This part is the simplest – and doesn’t require any custom CSS at all.
1. Create a background image. You can do this in simple, free online image editors – like pixlr.com, for example. The image should be as small as possible, since we’ll just repeat it across the screen. For example, it might be a solid blue line that is 100px tall and just 3 px wide. Like this one.
2. Upload the background. If you wanted this as the background for the top of the site – to create the look of a fluid header – then upload it to Design Mode on the BODY element as a background, and tile it horizontally using the options in the Options Panel.
If you only want a fluid header, you can stop here. If you want a fluid footer, then you can go one step further. Right now, this one does require a little custom CSS (and, again, we will be improving this in the future)
Fluid Fooder
3. Create your footer background. Maybe this one’s black! With a gradient overlay! Mix it up a little, have fun!
Anyway, same principle as before – small, and repeatable! Like this one!
4. Upload to the Media Library in WordPress. Keep the link to the file handy, we’ll need it in a moment.
5. Add the CSS. Go to the VIsual Editor in Manage or Design mode to access the Live CSS (members only) editor.
Code:
body.custom #whitewrap {
background-image: url(http://yourdomain.com/wp-content/uploads/1/12/footerbg.jpg);
background-repeat: repeat-x;
background-position: bottom left;
}
What does this do?
It adds a background to another full-screen element in Headway – the “Whitewrap” – which comes directly after the body and covers 100% of the screen. By using this, we can appear to have two background images (or one image that has a “fluid” center that grows with the content on the page). We’ve set the backgound to appear on the bottom left of the page, and to repeat across (x) the screen.
Spread the word!
By adding a comment below, you agree to abide by our comment policy.
