PDA

View Full Version : HOW-TO: Three column 'bottom sidebar'


eli
February 20th, 2006, 12:08
Here's a <a href="http://www.elifoner.com/2006/02/18/how-to-three-column-bottom-sidebar/">very rudimentary tutorial</a> on how to achieve a 3-column 'bottom-sidebar', best suited to single-column sites.

Comments/questions/feedback?

tauquil
February 20th, 2006, 12:59
Just that it's not quite working right in Safari yet...

Scott
February 20th, 2006, 01:46
I have this running on my blog and am still working on the styling. I want it to look like frotzed's at http://openswitch.org (he's using tables though). The problem that I am running into is that in Firefox the glass-block div isn't adjusting to the height of the content. It's mostly working on IE7b (although I have a mystery white space at the bottom).

Any ideas? The only attribute I can get to change the div height in FF is "height: 300px;" (which is a fixed and not flexible attribute). I'm afraid that most of my CSS knowledge is trial-and-error.

Here's my CSS

#glass-bottomblock { /* This is the main bottomblock container */
display: block;
width: 780px;
_width: 740px;
padding: 15px 0px 15px 0px; /* Padding is INSIDE the element, and goes TOP RIGHT BOTTOM LEFT */
margin: 0px 0px 0px 0px; /* Margin is OUTSIDE the element */
background: #EDEDED;
border-top: 1px solid #000000;
border-bottom: 1px solid #000000;
font-family:?Lucida Sans?, ?Lucida Grande?, ?Trebuchet MS?, Arial, Helvetica, sans-serif;
}

#glass-bottomblock h2 { /* The centered titles above the contents */
margin: 0px 0px 0px 0px;
padding: 0px;
text-align: center;
}

.leftcol {
width:220px;
height: auto;
float:left;
position:relative;
padding: 0px 15px 0px 30px; /* Padding is INSIDE the element, and goes TOP RIGHT BOTTOM LEFT */
_padding: 0px 10px 0px 20px;
}

.rightcol {
width:220px;
height: auto;
float:right;
position:relative;
padding: 0px 30px 0px 15px; /* Padding is INSIDE the element, and goes TOP RIGHT BOTTOM LEFT */
_padding: 0px 20px 0px 10px;
}

.maincol {
width:220px;
height: auto;
float: left;
display:inline;
position: relative;
padding: 0px 15px 0px 15px; /* Padding is INSIDE the element, and goes TOP RIGHT BOTTOM LEFT */
_padding: 0px 10px 0px 10px;
background-color: #FFFFFF; /* Temporary so I can see what's going on with the padding */
}

Here's what's in the bottomblock.php file

<?php { ?>
<div id="glass-bottomblock">

<div class="leftcol">
<h2>Latest Comments</h2>
<p>Lorem ipsum dolor sit amet...</p>
</div>

<div class="maincol">
<h2>Latest Posts</h2>
<p>Lorem ipsum dolor sit amet...</p>
</div>

<div class="rightcol">
<h2>About</h2>
<p>Lorem ipsum dolor sit amet...</p>
</div>

</div>
<?php } ?>

tauquil
February 20th, 2006, 02:27
I have a similar footer theme going on at my site: http://tauquil.com

Feel free to check the stylesheet, it's certainly not the prettiest but seems to work across most browsers.

eli
February 20th, 2006, 03:08
Loving your bottom block, Tauquil! Keep it up! :)

tauquil
February 20th, 2006, 03:19
Thank eli :) I've been neglecting the design a bit recently but I have got a few tricks up my sleeve I want to try out...now it's just a matter of having the skills! :p

Scott
February 20th, 2006, 08:33
Taquil, thanks! I took a look at your stylesheet and page (nice tribute to Guiness, btw). In terms of horizontal positioning I have the three bottom columns working in FF, IE7b and IE6. The wrapper class made all the difference.

However, I am still having a couple of the same problems as earlier. IE6 is the only browser that adjusts the height of the div for the content (you'll note in FF and IE7b that the "lorem ipsum" paragraph under the About section carries over.

Also, there is still the mystery whitespace at the bottom (before the footer div).

tauquil
February 20th, 2006, 08:59
Scott, for the footer I actually created another .php file called mainfooter.php which I then called on top of the footer.php on the main page. Maybe that's why I'm not having some of the spacing issues?

Scott
February 20th, 2006, 09:10
Using Eli's tutorial, I also have a separate PHP file for the three columns (bottomblock.php). It is called on the index.php file right before the footer call...but you got me thinking so I went into the footer and saw that the first line was...

<br class="clear" />

I removed it and put it at the beginning of the bottomblock.php file. Bingo...no more white space. I still have the issue of adjusting the div for the height of the content, but I feel like I'm making progress again. Good old trial and error (note to self...must buy that blog design book when it comes out).

PS - I wrapped that br line with HTML tags. Anyone know why it put those forward slashes in there?

Scott
February 20th, 2006, 11:28
I gave up. :( I'm not ready to be the one to integrate this into the standard K2 theme.

ruimoura.net
February 21st, 2006, 01:19
Well i had the same problem as Scot with the "#glass-bottomblock" thing ... The gray block appears at the top of the page, not at the bottom, as it should.
If you add a "float: right/left;" it goes to the right place tough.

Someone had the same problem ?

frotzed
February 21st, 2006, 04:07
Scott: The problems you're having are the reason I went with second-class tables. It's not the ideal solution but 1) it's only a small section of my site and 2) it consitently displays correctly in every browser I've tried.

I've spent hours upon hours trying to get divs to yeild the same results and just can't get it to work right.

Eli, your tutorial is very easy to use but I need help implementing it on my blog which is 775 px wide. I can't figure out how to adjust your tutorial appropriately.

ruimoura.net
February 21st, 2006, 04:30
I made it allready ... You just need to mess with the "widht" in the css of the blocks.

Ps: i'm doing it on my local server, not online ...

frotzed
February 21st, 2006, 04:54
I did it! Woo Hoo! Thanks Eli for that tut. Ruimoura is right, I just messed with the width attributes. Nice nice nice. So glad I don't have to rely on tables anymore! To the tables I say, "Get thee behind me, Satan."

eli
February 23rd, 2006, 07:12
I've been doing a little network upgrade and haven't been around. Glad you made use of the howto. The next tutorial will be a hover/slide down box like that of http://shauninman.com and http://massiveblue.net/pepperminttea.