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.
By Anonymous (not verified) on
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
You can do it with pure
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
Thanks