Hello,

I am building a 2-column theme. Both the content div and sidebar div are in a wrapper. When the sidebar div is empty (not displayed) I want the content div to take up the full space of the wrapper. All with no float drops, to text-wraps, etc.

I think I could use If statements in the templates to give different classes to divs, with corresponding css. But I'd like to find a way that doesn't mean changing the templates. What is the easiest way to do this? Is there a pure CSS way?

Thanks,
-Mtro

Comments

komal.savla’s picture

Hi,
You can do it with pure css.
Use the firebug and inspect the element.When the sidebar div is empty the body takes the class no-sidebars in case you are using the zen theme. So you can give the css like this to your content

.no-sidebars #content {
  width:100%;
}

Thanks