Logic question here.

How do I style my theme so that the content column is flexible within the layout? Lets say I have a two column setup, the sidebar is 200px wide but is not always included on the page depending on block configs. I want the other content column to display either at like 600px with there is a sidebar, or 800px when there is no sidebar.

I've tried making the width of the content column a %, or I have tried the min and max_width attributes, I have struggled with clear:left/right/both/none, and I just don't know the trick. The closest I have come is that the content column displays properly when it is alone, but gets pushed downward when the sidebar is present. If I were using tables it would be so easy but...

Anyone have any insight?

Comments

sunshinee’s picture

The short answer is that you need to (a) set a margin , or (b) float your elements.

The REAL answer to this depends on what theme you're using (I assume it's a custom theme) and how you've defined your css. I would suggest studying the layout.css in Garland or Zen, as both of these themes do a beautiful job with fluid layouts.

Hope this helps. :)

silverwing’s picture

try downloading and looking at the code for danger4k theme http://drupal.org/project/danger4k

If i remember correctly it does something like what you need.

~silverwing

_____________________________________________
Land of Midnight | MisguidedThoughts | showcaseCMS