css container query

T

Tom

Hi
I want to have a container around 2 columns with a background image. In IE
the container expands depending on the content but in Mozilla I seem to have
to specify the height of the div to be able to see it... you will notice
that it looks ok in IE but the background image is not showing in Mozilla
I have done similar before and it worked fine but there seems to be a
problem now.
Link is http://www.lightbox.ie/test/
If anyone had any thoughts it would be great... basically I want the div
with id of mcc to expand as the divs leftcontent and rightcontent expand...
Thanks in advance
Tom
 
G

GD

Tom said:
I want to have a container around 2 columns with a background image.

If you've floated the left and right columns then the containing block
will collapse to fit the remaining content. If the floated columns are
the only thing in the container then it will collapse to zero-height.

To make it expand to fit the floated columns you need to put something
after them and use the CSS clear property (its values can be 'left',
'right' or 'both'). Example:


<div style="border:black solid 1px;">
<p style="float:left; width:50%;">Floated left</p>
<p style="float:right; width:50%;">Floated right</p>
<p style="clear:both;><a href="#top">Back to top of page</a></p>
</div>
 
R

Richard

Tom said:
Hi
I want to have a container around 2 columns with a background image. In
IE the container expands depending on the content but in Mozilla I seem
to have to specify the height of the div to be able to see it... you will
notice that it looks ok in IE but the background image is not showing in
Mozilla I have done similar before and it worked fine but there seems to
be a problem now.
Link is http://www.lightbox.ie/test/
If anyone had any thoughts it would be great... basically I want the div
with id of mcc to expand as the divs leftcontent and rightcontent
expand... Thanks in advance
Tom


Try my solution. http://1-large-world.com/samples/sample1.html
http://1-large-world.com/samples/sample2.html

Place your menu links inside the "header" division as well as your banner.
Use the "sidebar" division as desired.
Or not at all and add your graphics into another division using
"float:left;".
 
T

Tom

If you've floated the left and right columns then the containing block
will collapse to fit the remaining content. If the floated columns are
the only thing in the container then it will collapse to zero-height.

To make it expand to fit the floated columns you need to put something
after them and use the CSS clear property (its values can be 'left',
'right' or 'both'). Example:

Thanks
That sorts it out... had problems with the clear properties before...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top