Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



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

Posts: 104
Location: UK
Trades: 0
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!
 
 
Register now for full access!
Old 11-02-2007, 10:47 AM Re: Two div containers - background colour
Novice Talker

Posts: 14
Name: Jared
Trades: 0
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, 11:39 AM Re: Two div containers - background colour
pjb007's Avatar
Super Talker

Posts: 104
Location: UK
Trades: 0
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, 12:05 PM Re: Two div containers - background colour
joder's Avatar
Flipotron

Posts: 6,442
Name: James
Location: In the ocean.
Trades: 0
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, 01:10 PM Re: Two div containers - background colour
pjb007's Avatar
Super Talker

Posts: 104
Location: UK
Trades: 0
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, 02:05 PM Re: Two div containers - background colour
joder's Avatar
Flipotron

Posts: 6,442
Name: James
Location: In the ocean.
Trades: 0
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, 02:47 PM Re: Two div containers - background colour
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
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 !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 11-02-2007, 03:41 PM Re: Two div containers - background colour
Foundationflash's Avatar
Ultra Talker

Posts: 410
Name: Harry Burt
Location: Colchester, Essex, England
Trades: 0
It does sound an awful lot like you want that faux column method as above.
__________________
Foundation Flash tutorials :
Please login or register to view this content. Registration is FREE


New Dreamed Up Web Design:
Please login or register to view this content. Registration is FREE
Foundationflash is offline
Reply With Quote
View Public Profile Visit Foundationflash's homepage!
 
Old 11-03-2007, 02:10 PM Re: Two div containers - background colour
pjb007's Avatar
Super Talker

Posts: 104
Location: UK
Trades: 0
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 02:28 PM..
pjb007 is offline
Reply With Quote
View Public Profile Visit pjb007's homepage!
 
Old 11-03-2007, 03:42 PM Re: Two div containers - background colour
maxxximus's Avatar
Extreme Talker

Posts: 219
Name: Rob
Location: UK
Trades: 0
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 Search this Thread
Search this Thread:

Advanced Search

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 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.48518 seconds with 12 queries