Do I have too many DIVS and how do I make some expand based on content?

Attached is a layout for a site I am working on.  You will notice many DIVS within DIVS. As far as the CSS goes, I can pretty much make it work, except for 2 DIVS that I want to expand based on the content of a third DIV.  Here is some more info:

Every DIV has a fixed height and width except "Left Middle", Main Middle", and "Right Middle". This is shown with the arrows. "Left Middle" and "Right Middle" have a small graphic that I want to repeat Y.
"Main Middle" will always be long enough to at least reach below the tops of "Left Middle" and "right Middle", so we don't have to worry about figuring out how to get "Main Middle" to expand due to lack of content.
Notice that all three of the DIVS that expand are contained within separate DIVS
I just noticed that the "Left", "Right", and "Main" DIVS are not contained within one DIV, which if I need I will call "Content".
Am I using too many Divs? I know I can use the "Overflow: hidden" style but I am not sure which DIVS to put that on.

Thanks in advance. LAYOUT.pdf
Robert FrancisDirector of Continuous ImprovementAsked:
Who is Participating?
 
s8webConnect With a Mentor Commented:
What is the purpose of the divs:

left
lefttop
leftmiddle
middletop
rightmiddle
righttop

Are spacers 1-4 divs?

Are buttons 1-4 divs?

Do you have a mock-up of what you want it too look like in the end?
0
 
Robert FrancisDirector of Continuous ImprovementAuthor Commented:
www.speedysigns4u.com

Yes they are all divs.

0
 
s8webCommented:
Yes, that's a bit many containers for what you're trying to pull off. The mantra of developers is KISS. Keep it simple stupid, or keep it stupid simple if you want the nice version (not to imply anyone's stupid or anything :)) Give me a bit, I'll work out an example for you.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
Robert FrancisDirector of Continuous ImprovementAuthor Commented:
Cool. I figured I could use just one container for the buttons instead of all the divs for the spacers and buttons.
0
 
s8webCommented:
I would do something like this.
princeservice.zip
0
 
s8webCommented:
Don't forget to delete the source file (.psd) if you publish the assets/img folder. It adds 963kb.
0
 
s8webCommented:
If there isn't enough content in lboxmid, to expand the box, you can add min-height to #maincontent. If you care about ie6 (I don't) you can do:

#maincontent{min-height:somethingpx}
*html #maincontent {height:somethingpx}

ie6 doesn't get min-height. It's not going to get the transparency stuff either, but it will be usable in ie6.

Tested in FF3,4 IE7,8, Chrome. FF4 seems to have a bug with fixed backgrounds at the moment.
0
 
Robert FrancisDirector of Continuous ImprovementAuthor Commented:
Hey s8web,

I am just now seeing that you posted. I won't have a chance until Monday morning to review. Just giving you a heads up. I am not ignoring you.

THanks
0
 
Robert FrancisDirector of Continuous ImprovementAuthor Commented:
I do have a question. How did you slice using guides?
0
 
s8webCommented:
I'm not sure I understand. I just use the guides as a visual reference.
0
 
Robert FrancisDirector of Continuous ImprovementAuthor Commented:
I just noticed that your photoshop file had guides but no slices on it. just curious. Everything else is working great. I have learned a lot so far.
0
 
s8webCommented:
I do all the slicing manually.
0
 
Robert FrancisDirector of Continuous ImprovementAuthor Commented:
Cool. One more question if you dont mind. The reason I did some of those crazy slices is I couldn't figure out how to save an image where the shadow blends to transparency. Do you have a quick answer for that problem? Please see screencast.

 princeservice-437763.flv
0
 
s8webCommented:
You have to use an image file type that supports transparency. PNG24 is what is most often used. There is also PNG8 which is lossy, and gif which is even lossier. If you use the export for web option in photoshop, you can get a pretty decent preview. Depending on the size and complexity of the image, PNG24 is usually manageable, especially if you use it in a situation where it's only a pixel high or wide and repeats.

CSS3 is cool because all of the things you want to do are supported natively without the use of background images (curved edges, shadows, gradients). It unfortunately will be a while before you can use CSS3 exclusively. Microsoft didn't start supporting it until IE9 which probably won't do well because it doesn't support XP. That means something like 50% of the browsers out there are IE7 and 8. So we're stuck with images as backgrounds for a while.

IE6 doesn't support background images. There are some javascript workarounds for IE6 if you're inclined, but MS stopped supporting IE6, and there's no reason why folks should still be using it.
0
 
Robert FrancisDirector of Continuous ImprovementAuthor Commented:
Yes. The preview with PNG24 is exactly what I needed. You have been more help then you could imagine. Wish I could give you 1000 points.

Thanks
0
 
s8webCommented:
My pleasure, take care.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.