Reply
Two div containers - background colour
Old 11-02-2007, 11:30 AM Two div containers - background colour
pjb007's Avatar
Super Talker

Posts: 100
Location: UK
I am sure I have done this before but can't remember how.

Basically I have two div containers, one is 80% wide the other 20%.

The wider conteiner containes lots of content and narrow one does not.

I want the background of the narrow one to continue beyond the last line of text.

Any suggestions?

It works in IE but typically not FireFox
__________________
pjb007
pjb007 is offline
Reply With Quote
View Public Profile Visit pjb007's homepage!
 
When You Register, These Ads Go Away!
Old 11-02-2007, 11:47 AM Re: Two div containers - background colour
Novice Talker

Posts: 14
Name: Jared
You mean the height of the narrow container?
I don't really understand..
ArsonistX is offline
Reply With Quote
View Public Profile
 
Old 11-02-2007, 12:39 PM Re: Two div containers - background colour
pjb007's Avatar
Super Talker

Posts: 100
Location: UK
There are two containers one contains lots of content the other does not.

The background colour appears down to the last line of text in that container which means that there is white space below the one container, I want this to continue down to the same level as the neighbouring container.
__________________
pjb007
pjb007 is offline
Reply With Quote
View Public Profile Visit pjb007's homepage!
 
Old 11-02-2007, 01:05 PM Re: Two div containers - background colour
joder's Avatar
Flipotron

Posts: 6,443
Name: James
Location: In the ocean.
Are you wrapping them in another div?

Example:
HTML Code:
<div id="wrapper">
    <div id="leftdiv">
    </div>
    <div id="rightdiv">
    </div>
<div>
joder is offline
Reply With Quote
View Public Profile
 
Old 11-02-2007, 02:10 PM Re: Two div containers - background colour
pjb007's Avatar
Super Talker

Posts: 100
Location: UK
I have tried with and without a wrapper.
__________________
pjb007
pjb007 is offline
Reply With Quote
View Public Profile Visit pjb007's homepage!
 
Old 11-02-2007, 03:05 PM Re: Two div containers - background colour
joder's Avatar
Flipotron

Posts: 6,443
Name: James
Location: In the ocean.
If you don't have a link or code, it's hard to help.
joder is offline
Reply With Quote
View Public Profile
 
Old 11-02-2007, 03:47 PM Re: Two div containers - background colour
LadynRed's Avatar
Super Moderator

Posts: 6,699
Location: Tennessee
You might want to read this stickie:
http://www.webmaster-talk.com/css-fo...l-browser.html

You could also try the Faux Columns method:
http://www.alistapart.com/articles/fauxcolumns/
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 11-02-2007, 04:41 PM Re: Two div containers - background colour
Foundationflash's Avatar
Ultra Talker

Posts: 410
Name: Harry Burt
Location: Colchester, Essex, England
It does sound an awful lot like you want that faux column method as above.
__________________
Foundation Flash tutorials : www.foundation-flash.com

New Dreamed Up Web Design: www.dreamedupdesign.com
Foundationflash is offline
Reply With Quote
View Public Profile Visit Foundationflash's homepage!
 
Old 11-03-2007, 03:10 PM Re: Two div containers - background colour
pjb007's Avatar
Super Talker

Posts: 100
Location: UK
Here is an example of the problem.

I have used two different colours for this example (in my site they will be the same colour)

How can I get the background colour of the navigation area to continue down and stop in the same place as the background area of the main content.

A basic example is shown below normally i use an external style sheet.

Code:
<html>
<head>

<style type="text/css">
#nav {background-color: green; float: left;}
#content {background-color: yellow; float: left;}
</style>

</head>
<body>

<div id="nav">
Line 1 <br />Line 2<br />Line 3<br /> Line 4<br />
</div>

<div id="content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore 

et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip 

ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 

fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt 

mollit anim id est laborum.</p>

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore 

et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip 

ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu 

fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt 

mollit anim id est laborum.</p>

</div>

</body>
</html>
Hope this helps explain things a little better.
__________________
pjb007

Last edited by pjb007 : 11-03-2007 at 03:28 PM.
pjb007 is offline
Reply With Quote
View Public Profile Visit pjb007's homepage!
 
Old 11-03-2007, 04:42 PM Re: Two div containers - background colour
maxxximus's Avatar
Extreme Talker

Posts: 205
Name: Rob
Location: UK
Yes faux columns probably best.

However a simple fix that would work well here is to wrap the two divs and apply overflow:hidden to the wrapper.

#wrapper{background-color: green; overflow:hidden; width:100%}
maxxximus is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Two div containers - background colour
 

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

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




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.15408 seconds with 12 queries