View Full Version : Div background fill another div?

12-18-2006, 01:47 AM

I am trying to code a site based on a design I came up with.



Basically, I want where it says "hmmmm" to cover that whole purple section like on my design. I can't put a fixed width because the page is fluid. Then on top of that, I want to have a white section.

I can probably figure out the curves, but can't get the colors to extend.

Any help would be greatly appreciated. Also, sorry that my css at the top is sloppy. I'm going to organize it on any external page once I get this work. Thanks!

12-18-2006, 02:18 AM
Hello Isatblu,
To be fluid and use percentages I think you'll need to use percentages everywhere. At least inside of #content...


#main-left-blue {
margin: 0;
padding: 0;
float: left;
height: 500px;
width: 80%;
background: #DAE6ED;
#main-right {
margin: 0;
padding: 0;
width: 20%;
float: right;
background: #6584AE url(right-bg.jpg);

12-18-2006, 03:15 AM
That brings the color over, but my navigation on the right gets messed up. I can't figure out a way to have it look the way I want with it being fluid.

If you stretch out your browser really wide, my items on my right nav move and the background repeats.

Are there any other ways to go about this?

12-18-2006, 07:58 AM
Maybe 70/30 instead of 80/20? Hard to say...

12-18-2006, 08:05 AM
I really wish it would be a fixed with. But just on the right. Is there no way to do that? With a percent on both sides, my right nav becomes either too large or small.

12-18-2006, 08:09 AM
Something some people don't realize when they think about a fluid layout is usually only the content is fluid and the sidebar is a fixed width. Check out this example


12-18-2006, 08:44 AM
That is exactly what I was looking for. Thank you!