By gleble on
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
Don't See Problem
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
block.tpl.php
Could this be the problem?
block.tpl.php
No, that's not the problem.
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
node.tpl.php
No, I haven't altered any other themes. I have only this custom theme which has no more .tpl.php files
What about this?
Trouble
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.