I have a layout that is working, but it has one very annoying problem.. when the content is taller than the screen, the background stops.
This is the desired layout in bad-ASCII-art format:
_____________________ _
| | long |logo| |
| | content | | |
| | | | |
| | | | |
|grad| |grad| | Viewport
| | | | |
| | | | |
| | | | _|
| | | |
| | | |
_____________________
|2em| <-20em->| 2em|
..or with short content..
_____________________ _
| | short |logo| |
| | content | | |
| | | | |
| | | | |
|grad| |grad| | Viewport
| | | | |
| | | | |
| | | | |
| | | | |
_____________________ _|
Basically it looks like a single column, with a glow as a column either side. Over the left-glow is a logo. When the content is short, it is still the full-height.
I have tried using the CSS min-height hack, which fixes the middle column, but then the gradients only extend as far as the content (in the left column, a single
, in the right column the logo)
Here is what the layout looks like:
And the problem (when the browser window is shrunk vertically):
Finally, the problem HTML/CSS, http://data.dbrweb.co.uk/tmp/fifestock_layout_problem/
Given that you have your gradients in seperate columns to the left and right, you need to implement "faux columns".
If you're after elastic versions, have a look at Elastic Faux Columns and Multi-Column Layouts Climb Out of the Box.
Here's what I ended up using, using this technique of high value for
padding-bottom
, with an equal but inverted value inmargin-bottom
- then you setoverflow:hidden
on the div enclosing that huge margin.It's rather hackish, but it works! I now have a full-height, a single em-defined width, and a full-height background-image down each side! There's not much extra markup (a container div, a div for each of the three columns)
I just watched a video about YUI's grids and looked very promising (recommended watching!). I haven't had the time to test it out, yet, but most probably will do so in the future. It might be what you want.
Try with this modifications:
Got there in the end with this one, but had to make a few changes to your markup and the images.
So the markup looks like this now:
Then, the relevant changes in the stylesheet are:
Looks fine to me.
Only tested in in FF3 and Opera (running Linux without access to Windows / Mac atm) but I don't think there should be any big issues with it in IE / Opera.
Add this after
<div id="right">...</div>
: