If I have blocks in the side bar the content is forced down in the main section. I've attached style.css and page.tpl.php. Can anybody see what's causing the problem? I'm new to themeing and it's driving me mad. I could fix it with relative positionning but that's bound to cause other problems.
page.tpl.php

<html>
<head>
<title><?php print $head_title ?></title>
<?php print $styles ?>
<body>
<div id="container">
<div id="header">
<h1><?php print $site_name ?></h1>
<?php print $header ?>
</div>
<?php if ($left): ?>
<div id="sidebar-left">
<?php print $left ?>
</div>
<?php endif; ?>
<div id="main">
<?php print $breadcrumb ?>
<h2><?php print $title ?></h2>
<?php print $content ?>
</div>
<div id="footer">
<?php print $footer_message ?>
<?php print $footer ?>
</div>
</div>
<?php print $closure ?>
</body>
</html>

style.css

#container {
width: 90%;
margin: 10px auto;
background-color: #fff;
color: #333;
border: 1px solid gray;
line-height: 130%;
}
#header {
padding: .5em;
background-color: #ddd;
border-bottom: 1px solid gray;
}
#header h1 {
padding: 0;
margin: 0;
}
#sidebar-left {
float: left;
width: 160px;
margin: 0;
padding: 1em;
}
#main {
margin-left: 200px;
border-left: 1px solid gray;
padding: 1em;
max-width: 36em;
}
#footer {
clear: both;
margin: 0;
padding: .5em;
color: #333;
background-color: #ddd;
border-top: 1px solid gray;
}
#sidebar-left p {
margin: 0 0 1em 0;
}
#main h2 {
margin: 0 0 .5em 0;
}

Comments

callison’s picture

Based on the code you pasted, I don't see the problem you are mentioning. The left sidebar floats left just fine leaving room for the content. Is there something else besides these files that might be interfering?

Regards,

Chris

www.allisonmission.com

gleble’s picture

Could this be the problem?
block.tpl.php

<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="block block-<?php print $block->module ?>">
<?php if ($block->subject): ?>
  <h2><?php print $block->subject ?></h2>
<?php endif;?>

  <div class="content">
    <?php print $block->content ?>
  </div>
</div>
callison’s picture

No, that's not the problem. Have you customized any theme files besides page.tpl.php, block.tpl.php and style.css?

www.allisonmission.com

gleble’s picture

No, I haven't altered any other themes. I have only this custom theme which has no more .tpl.php files
What about this?

 <div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?> clear-block">

<?php print $picture ?>

<?php if (!$page): ?>
  <h2><a href="<?php print $node_url ?>" id="title" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php endif; ?>

  <div class="meta">
  <?php if ($submitted): ?>
    <span class="submitted"><?php print $submitted ?></span>
  <?php endif; ?>

  <?php if ($terms): ?>
    <div class="terms terms-inline"><?php print $terms ?></div>
  <?php endif;?>
  </div>

  <div class="content">
    <?php print $content ?>
  </div>

  <?php print $links; ?>
 
</div>

callison’s picture

Well, I saw your trouble. It seems that something about the content divs. You might try removing elements one at a time to try and figure out what is causing the problem. Sorry - I wasn't able to figure out what the problem is.