navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

DIV's overspilling my Container DIV in Firefox

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> DIV's overspilling my Container DIV in Firefox
Page: [1]
 
craigj1303

 

Posts: 29
Joined: 5/16/2007
Status: offline

 
DIV's overspilling my Container DIV in Firefox - 5/16/2007 10:25:11   
Hi all

I am presenting thumbnails within a container DIV. The container has no height attribute in the CSS file. I am working on 3 different pages of thumbnails all with different numbers of thumbnails within.

In IE the height of the container DIV increases and decreases depending on how many thumbnails are within it. However, in Firefox the thumbnails "overspill" outside of the container DIV unless I specify a height attribute in the CSS to make it high enough. Obviously I don't want to do this because every page needs to be a different height.

Is there anything I can put in the CSS to make Firefox adjust the height of the container DIV depend on how many thumbs there are like IE does?

This is the CSS I have:

#gallerycontainer {
 width: 700px;
 margin: 0 auto;
 background: #EFE6C5;
 text-align: center;
 border: solid black 1px;
 }
 
.galleryimg {
 border: solid 1px #330000;
 border-width: 3px;
 }
 
div.mainleft{
 float: left;
 width: 232px;
 height: 180px;
 margin-top: 30px;
 }


Also, here is a link to the gallerys. Essex, Wales, West Country and Misc all have different number of images.

http://uk.geocities.com/johnson463@b...m/gallery.html
Donkey

 

Posts: 3866
Joined: 11/13/2001
From: Blackfield United Kingdom
Status: offline

 
RE: DIV's overspilling my Container DIV in Firefox - 5/16/2007 11:01:00   
Your link doesn't work so I can't test this, but I suspect a spacer div may be the answer. Try putting this in the CSS
/*
Spacer Div
*/
div.spacer{
clear: both !important;
}


And insert this inside the containing div but below the last thumbnail.
<div class="spacer">&nbsp;</div><!--/clears and spaces-->


_____________________________

:)

I have a higher and grander standard of principle than George Washington. He could not lie; I can, but I won't.
Samuel Clemens

(in reply to craigj1303)
Tailslide

 

Posts: 6003
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: DIV's overspilling my Container DIV in Firefox - 5/16/2007 11:24:17   
Because you're floating the thumbs they basically take up no space (well actually it's sort of like a single line's worth of space) so Firefox and other non-IE browsers can't expand the containing div to contain them.

If your clearing element isn't working then try adding "overflow:hidden" to the div which contains the floated thumbs - that usually does the trick.

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to Donkey)
craigj1303

 

Posts: 29
Joined: 5/16/2007
Status: offline

 
RE: DIV's overspilling my Container DIV in Firefox - 5/16/2007 13:10:35   
Thanks a lot guys, the spacer DIV worked great. Firefox now renders the page perfectly!

(in reply to Tailslide)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> DIV's overspilling my Container DIV in Firefox
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts