Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there an easy way to set the background color of the sidebars? Their length seems to be determined by the number of blocks they contain, so their background colour does not reach the bottom of the page.
I've looked at class="region region-sidebar-first column sidebar", but again it is not full length. And div#main-wrapper is full length, but it does not distinguish the article space (middle column) from the sidebars.
Comment | File | Size | Author |
---|---|---|---|
column-background-colors.jpg | 243.39 KB | iantresman |
Comments
Comment #1
eatingsYou'll have to equalize div heights with jquery or a similar technique; there isn't a way to do it in CSS.
Once your region divs have the same height, apply background styles as needed, et voila! C'est dans la poche.
Try something like http://www.filamentgroup.com/lab/setting_equal_heights_with_jquery/
Comment #2
KrisBulman CreditAttribution: KrisBulman commentedThis isn't a zen problem specifically, providing solutions and closing ticket, zen works as designed.
See the faux columns method
http://www.alistapart.com/articles/fauxcolumns/
Or you can use the jquery equalheights plugin
http://www.cssnewbie.com/equalheights-jquery-plugin/
Comment #3
iantresman CreditAttribution: iantresman commentedI agree that it's not a Zen bug, and Zen is not designed to work this way, but there is an argument to suggest that it should, on the grounds that there is no disadvantage if it worked this way.
Thanks for the suggestions. I think my workaround is to add a background image to <div id="main">, that just covers the two columns, and repeats down the div, your Faux Columns suggestion.
A better solution does appear to be available, such as that described in the article "Equal Height Columns with Cross-Browser CSS".
I also found (and there are many others) "Four Methods to Create Equal Height Columns".
But thanks for the feedback.
Comment #4
KrisBulman CreditAttribution: KrisBulman commentedthere's a D6 module
http://drupal.org/project/equalheights
And Omega D7 does have, or did have, it integrated into their base theme, but from my use of it, it doesn't work in all situations. I think it's a little beyond the scope of a base theme though, and should be added in a subtheme.
Comment #5
iantresman CreditAttribution: iantresman commentedOK, might have solved this with just CSS, following the useful suggestions in the aforementioned articles. The following CSS will give one of the sidebars a background color:
Comment #6
iantresman CreditAttribution: iantresman commentedComment #7
iantresman CreditAttribution: iantresman commentedOK, the "fix" doesn't work, when the main content is shorter than the sidebars. I think this is on the right track, so a little more research is necessary.
Comment #8
iantresman CreditAttribution: iantresman commentedHere's the corrected fix, just needed some extra css DIVs, now showing on both columns:
If both columns have the same background color, then this can be reduced to:
Comment #9
morrisjones CreditAttribution: morrisjones commentedWell done Ian! I wish I could get that proposed solution to come up higher in the Google search results.
Comment #10
hmartens CreditAttribution: hmartens commentedThis worked until I used an anchore tag...then it removes all the content above the anchore ;) But thanks, it worked great until I had to use anchors :)
Comment #11
diddism CreditAttribution: diddism commentedDo it the other way around. I have this CSS. Give main the color of the sidebar and content the color you want main to be.