how can I make this right bar bg go all the way down the page?

This is a discussion on "how can I make this right bar bg go all the way down the page?" within the Web Page Design section. This forum, and the thread "how can I make this right bar bg go all the way down the page? are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 31st, 2007, 03:38
Junior Member
Join Date: Jul 2007
Location: zimwabee
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Question how can I make this right bar bg go all the way down the page?

The background of this sidebar is not going all the way down the page. I have tried height: 100% and nothing. Anyone ever have this problem, how can I fix it. Here is the link:http://www.mdoneonone.com

Thanks

PS: how do you like my site design.
Reply With Quote

  #2 (permalink)  
Old Jul 31st, 2007, 07:29
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

What you want is for the two columns to match heights, as cells in a <table> would. Unfortunately, since <div>s don't use the same rendering rules as <table> cells, you have to hack it.

The most popular hack is faux columns, and this is probably the best choice for you. Personally I don't like it, because I prefer elastic layouts, and faux columns won't work when your columns change widths.

The correct solution would be to set the <div>s to display: table-cell; using CSS. This will make them render exactly as though they were cells in a <table>, so equal heights are automatic.

But Internet Explorer (IE) does not support this incredibly useful, standard CSS display type. I use javascript to fix IE's bad rendering.

Last edited by MikeHopley; Jul 31st, 2007 at 07:43.
Reply With Quote
  #3 (permalink)  
Old Jul 31st, 2007, 08:01
Reputable Member
Join Date: Oct 2006
Location: UK
Age: 25
Posts: 105
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cullinanweb Send a message via Skype™ to cullinanweb
Re: how can I make this right bar bg go all the way down the page?

wrap the whole thing in a div and set the background of that dive to the color you want so say

<div id="contentwrapper">
<div id="left">content for left</div>
<div id="right">content for right</div>
</div>

content wrapper and right would have the same background colors and left would be the other color.

you will also need to add a clear both fixing div

need any further help let me know.
Reply With Quote
  #4 (permalink)  
Old Jul 31st, 2007, 10:03
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

That's a good, simple solution; but it will only work if the left column is always longer than the right.

Quote:
Originally Posted by cullinanweb View Post
wrap the whole thing in a div and set the background of that dive to the color you want so say

<div id="contentwrapper">
<div id="left">content for left</div>
<div id="right">content for right</div>
</div>

content wrapper and right would have the same background colors and left would be the other color.

you will also need to add a clear both fixing div

need any further help let me know.
Reply With Quote
  #5 (permalink)  
Old Jul 31st, 2007, 15:50
Junior Member
Join Date: Jul 2007
Location: zimwabee
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

Quote:
Originally Posted by cullinanweb View Post
wrap the whole thing in a div and set the background of that dive to the color you want so say

<div id="contentwrapper">
<div id="left">content for left</div>
<div id="right">content for right</div>
</div>

content wrapper and right would have the same background colors and left would be the other color.

you will also need to add a clear both fixing div

need any further help let me know.
I tried that its not working? What did I do wrong? Here is my css:

Code: Select all
#contentandbar {
    background-color: #FFD8A5;
    clear:both;
}

Last edited by charlie019; Jul 31st, 2007 at 16:24.
Reply With Quote
  #6 (permalink)  
Old Jul 31st, 2007, 16:01
SuperMember

SuperMember
Join Date: May 2006
Location: North West, UK
Age: 21
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

Mike, you really shouldn't be using JavaScript for presentation. JS should be for behaviour only. I refuse point blank to blur the lines. There are three common layers that make up a page or document. Structure/content, presentation and behaviour and I am very strict about keeping them separate.

Pete.
Reply With Quote
  #7 (permalink)  
Old Jul 31st, 2007, 16:31
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

Do you have a link? You didn't post enough of you code to know what you did wrong.
Reply With Quote
  #8 (permalink)  
Old Jul 31st, 2007, 16:49
Junior Member
Join Date: Jul 2007
Location: zimwabee
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

Quote:
Originally Posted by Lchad View Post
Do you have a link? You didn't post enough of you code to know what you did wrong.
I put the link in my first post: http://www.mdoneonone.com
Reply With Quote
  #9 (permalink)  
Old Jul 31st, 2007, 17:00
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

My apologies.. I didn't see the link.

Cullinanweb wanted you to put both the left and right columns in a wrapper div.

You do not currently have those columns in a wrapper.

Faux columns is the only way I know how to do this.
You make a background image that will repeat-y. Apply it as the background to the wrapper div.

Then you nest the left and right columns in the wrapper- No colored backgrounds on the left or right.

Without faux columns you will never get the two columns to appear to match in length.
Reply With Quote
  #10 (permalink)  
Old Jul 31st, 2007, 18:33
Junior Member
Join Date: Jul 2007
Location: zimwabee
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

Quote:
Originally Posted by Lchad View Post
My apologies.. I didn't see the link.

Cullinanweb wanted you to put both the left and right columns in a wrapper div.

You do not currently have those columns in a wrapper.

Faux columns is the only way I know how to do this.
You make a background image that will repeat-y. Apply it as the background to the wrapper div.

Then you nest the left and right columns in the wrapper- No colored backgrounds on the left or right.

Without faux columns you will never get the two columns to appear to match in length.
How would I go about using the faux columns? Where should I put the bg code?
Reply With Quote
  #11 (permalink)  
Old Jul 31st, 2007, 18:43
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

Either in the body { } or in a #wrapper div.

Click the link MikeHopley gave you at the beginning ... it should explain it there. Or do a google search for Faux Columns ... you should get A LOT of results
Reply With Quote
  #12 (permalink)  
Old Jul 31st, 2007, 18:48
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

Take a look at this tutorial it will explain it all!
Reply With Quote
  #13 (permalink)  
Old Jul 31st, 2007, 18:57
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

Hmmm yes ... that's the link I was talking about
Reply With Quote
  #14 (permalink)  
Old Jul 31st, 2007, 21:08
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

Quote:
Originally Posted by pa007 View Post
Mike, you really shouldn't be using JavaScript for presentation. JS should be for behaviour only. I refuse point blank to blur the lines. There are three common layers that make up a page or document. Structure/content, presentation and behaviour and I am very strict about keeping them separate.
Why, unless out of sheer religious zeal?

(X)HTML, CSS, and javascript are tools. Their purpose is to enable you to make accessible, interoperable, attractive, usable websites. They are not religious objects.

The separation of style, content, and behaviour makes for easier coding, with less maintenance; it's more logical and organised. It also makes pages smaller in file size. That's all it does.

Besides, how do you define behavior? Response to a user's actions? Then CSS link hover states should be handled by javascript! The partition is not quite as neat as you might think. You are perhaps suffering from "ontologist's delight" -- a wilful state of delighting in artificially perfect taxonomy.

CSS is good at some things; javascript is good at others. For the most part, the boundaries are quite clear. But there are areas of significant overlap.

In this particular case, I don't like using javascript. It's not as elegant. But I see no problem using a javascript work-around for IE, which fails to support such a basic part of the CSS standard. If javascript is off, then IE users just get a slightly inferior page presentation. So what?

Here's another example: to make rounded corners, we need extra markup. Okay, so this should be done in CSS; but CSS 3 is a long way off. But extra markup is annoying for me when I'm editing, so I use javascript to generate the extra presentational <div>s.

What you ask is nigh-on impossible. If you completely separated style and content, for example, then you would never use a single <div> in your markup (because its only possible purpose is as a presentational or behavioural hook). Your lines are already blurred; you just can't see it!

Last edited by MikeHopley; Jul 31st, 2007 at 21:19.
Reply With Quote
  #15 (permalink)  
Old Jul 31st, 2007, 21:32
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

In case anyone is interested, here's where I got my method from:

http://www.projectseven.com/tutorial...umns/index.htm

I think I edited their javascript to remove some strict errors; if you want my version, just ask.
Reply With Quote
  #16 (permalink)  
Old Jul 31st, 2007, 21:59
SuperMember

SuperMember
Join Date: May 2006
Location: North West, UK
Age: 21
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

Come now, Mike, you should know what I am like by now. Almost everything I do is on principle rather than for any practical reason. It all works, I just make my life extremely difficult. I think I am simply a glutton for punishment and one of those unrelenting purists.


Pete.
Reply With Quote
  #17 (permalink)  
Old Jul 31st, 2007, 22:18
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

Quote:
Originally Posted by pa007 View Post
Come now, Mike, you should know what I am like by now. Almost everything I do is on principle rather than for any practical reason. It all works, I just make my life extremely difficult. I think I am simply a glutton for punishment and one of those unrelenting purists.
Ha!

My point is that your principles may not be quite as principled as you think. If your idealism doesn't quite hold up to philosophical scrutiny, then why not give it up? It would make life easier.

Then again, maybe you're the addictive, immoderate type who would go on a blinding binge as soon as he relaxed the self-imposed strictures. One day, you're using javascript for an IE presentation hack; the next, you're back to tables and tag soup.

They do say a little alcohol is good for your health, but not, perhaps, if you're a reformed alcoholic.

Last edited by MikeHopley; Jul 31st, 2007 at 22:22.
Reply With Quote
  #18 (permalink)  
Old Aug 6th, 2007, 23:06
Junior Member
Join Date: Jul 2007
Location: zimwabee
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

nothing has worked
Reply With Quote
  #19 (permalink)  
Old Aug 7th, 2007, 01:51
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: how can I make this right bar bg go all the way down the page?

Charlie, seach google for faux columns. There must be a bunch of tutorials. Sometimes one tutorial doesn't make sense to me so I'll just keep trying them until I find one I understand.
Reply With Quote
  #20 (permalink)  
Old Aug 7th, 2007, 06:34
Reputable Member
Join Date: Oct 2006
Location: UK
Age: 25
Posts: 105
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to cullinanweb Send a message via Skype™ to cullinanweb
Re: how can I make this right bar bg go all the way down the page?

I have put together a simple emaple to see if you can work through it. Thgere is no tutorial included but it is what the others are getting at.
code:note: i have put the css in the html file which is not advised but done for quickness...


edit the image is included below too but is really small in the tumbnail so http://www.webforumz.com/attachment....7&d=1186468395
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Faux Coulms Example</title>
<style type="text/css">
<!--
#wrapper {
    height: auto;
    width: 944px;
    margin: 0 auto;
}
#header {
}
#navigation {
}
#main {
    background-image: url(faux-column.jpg);
    background-repeat: repeat-y;
}
#content {
    background-color: #EFDEB3;
    padding: 5px;
    height: auto;
    width: 655px;
    float: left;
}
#rightbar {
    background-color: #EFCD86;
    padding: 5px;
    float: right;
    height: auto;
    width: 260px;
}
#footer {
    clear: both;
}
.clearboth {
    clear: both;
    height: 1px;
    width: 100%;
}
p {
    margin-bottom: 10px;
}
* {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0px;
    padding: 0px;
}
-->
</style>
</head>

<body>
<div id="wrapper">
  <div id="header">
    <h1>Page Header</h1>
  </div>
  <div id="navigation">Navigation here</div>
  <div id="main">
    <div id="content">
        <p>Sed pretium urna. Nunc congue nunc quis dolor. Donec pharetra, ante in  molestie varius, dolor justo rhoncus mauris, non vestibulum leo velit  nec mauris. Duis risus. Nulla interdum porta odio. Curabitur venenatis  aliquam leo. Nulla facilisi. Vivamus lacinia scelerisque tellus. Proin  a felis. Ut vitae turpis non ipsum pulvinar ultrices. Donec in orci.  Vestibulum pellentesque leo. Suspendisse egestas, metus id interdum  tempor, nisi diam mollis lectus, eget scelerisque odio libero non  lorem. </p>
        <p>Nulla facilisi. Duis ipsum. Phasellus semper nonummy tellus. Fusce  pretium magna id dolor. Mauris elementum tellus et metus. Proin  vulputate leo sed est pellentesque commodo. Suspendisse semper  ultricies nunc. Aenean posuere est ac lacus. Suspendisse potenti. Proin  luctus, nisl a accumsan scelerisque, nisl erat aliquet magna, in mattis  urna lacus nec tellus. Maecenas sit amet dolor. Phasellus imperdiet,  urna vitae ullamcorper facilisis, enim ligula bibendum pede, sed luctus  nulla urna id leo. </p>
        <p>Aliquam pharetra. Vestibulum varius diam nec purus rutrum commodo.  Nullam in nisl. Suspendisse tellus lectus, sagittis nec, rutrum  lacinia, rhoncus at, leo. Sed enim. Nunc suscipit, ligula et elementum  faucibus, turpis sapien convallis odio, a pulvinar dui leo eu dolor.  Duis tempus varius pede. Vestibulum imperdiet, dui eget tincidunt  rhoncus, nunc erat laoreet nulla, pretium tristique sapien arcu vitae  lectus. Ut pellentesque rutrum nunc. Praesent at est. Curabitur quis  diam. Nam faucibus, ante at pretium vulputate, arcu ipsum tempus  lectus, ac rutrum turpis nunc pellentesque nibh. Mauris ac libero sed  risus facilisis sodales. Donec scelerisque, dolor sed eleifend  porttitor, nulla nibh pretium nibh, vitae dictum felis pede sit amet  sem. </p>
        <p>Cras viverra imperdiet ante. Curabitur tellus nisi, consectetuer sit  amet, auctor consectetuer, rhoncus in, sem. Mauris ante est, pretium  at, auctor nec, malesuada in, elit. In hac habitasse platea dictumst.  Sed massa eros, molestie non, tempus eu, fermentum vitae, neque. Aenean  tincidunt magna quis mauris. Sed porta, metus et tempus ornare, urna  ante iaculis erat, at congue lectus risus id ipsum. Vivamus at diam.  Etiam hendrerit luctus pede. Donec dictum sapien quis risus. Maecenas  mattis, nunc mattis convallis tristique, sem ligula tincidunt diam, at  gravida eros massa eu orci. Suspendisse ullamcorper leo a libero. Nulla  non elit. Sed rhoncus eros id nisl. Mauris tortor nibh, ultrices nec,  placerat sed, congue facilisis, enim. Vivamus odio tortor, blandit sit  amet, pharetra at, lacinia vel, risus. Morbi faucibus. Vivamus  fringilla mattis sem. Donec ut metus eget ante fringilla varius. Duis  quis diam. </p>
        <p>Sed pulvinar lacinia diam. Vestibulum commodo metus vitae lorem.  Cras non diam et orci porttitor congue. Pellentesque habitant morbi  tristique senectus et netus et malesuada fames ac turpis egestas.  Aliquam rutrum. Sed nulla quam, ornare vel, tincidunt ac, rutrum ac,  magna. Ut ut mi vel nisl vulputate aliquam. Phasellus tempus pede sed  urna. Fusce aliquet purus a risus. Mauris dui dui, laoreet sit amet,  tempor bibendum, sagittis ut, tellus. Pellentesque tempor feugiat ante.  Suspendisse vestibulum purus ut ipsum. </p>
    </div>
    <div id="rightbar">Right bar content goes here</div>
    <div class="clearboth"><!--x--></div>
  </div>
  <div id="footer">Your footer here</div>
</div>
</body>
</html>
Attached Images
File Type: jpg faux-column.jpg (442 Bytes, 25 views)
Attached Files
File Type: html faux-columns.html (4.5 KB, 13 views)
Reply With Quote
Reply

Tags
code

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to make a loading/intro page Zonglars Flash & Multimedia Forum 10 Nov 16th, 2007 14:14
How do i make my PSD Template into a working HTML Page homer09001 Web Page Design 23 Aug 1st, 2007 01:23
Make this my home page joshcxa JavaScript Forum 2 May 22nd, 2006 06:16
Ever try to make a web page launch local programs? Beansly Introduce Yourself 2 Apr 24th, 2006 14:14
can u make it so that the page loads into the iFrame? (from menu) rachy06 JavaScript Forum 1 Apr 14th, 2006 16:00


All times are GMT. The time now is 02:35.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24