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
divs extend beyond container when window size decreased
Old 08-29-2011, 02:44 PM divs extend beyond container when window size decreased
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
I have a nice image gallery going, but when you manually adjust the window size to a narrower width the thumbnail divs extend below the containing div. Am I clearing my floats wrong?
Thanks,
Matt

http://thesweetwatercabin.com/photos_alt.html

div.clearer
{clear: left;
line-height: 0;
height: 0;}
matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
 
Register now for full access!
Old 08-29-2011, 04:10 PM Re: divs extend beyond container when window size decreased
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
The DOM tree in Chrome shows that you have set a fixed height on several places. I can't see where they are coming from though

Here is what I mean:
HTML Code:
<div id="contentwrapper" class="column" style="height: 790px; ">
   <div id="contentcolumn" class="column" style="height: 790px; ">
      ...
   </div>
</div>

<div id="leftcolumn" class="column" style="height: 790px; ">
   ...
</div>
And the height changes if I resize the window and reload the page, which to me seems to suggest that there is some javascript that sets the height. But again, I cannot find anything that would cause this


EDIT: Oh, found it It's in the matching_columns.js file. Why would you use that in the first place?
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.

Last edited by lizciz; 08-29-2011 at 04:13 PM..
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 08-29-2011, 05:16 PM Re: divs extend beyond container when window size decreased
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
Hey! Thanks.
I use the matching column script to fill in background colors, so that the background colors extend all the way to the bottoms of all divs. See what happens when I take it out:
http://thesweetwatercabin.com/photos_alt.html

Is there a better way to get "matching columns"?
Thanks lizciz
matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
Old 08-30-2011, 01:00 AM Re: divs extend beyond container when window size decreased
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Yes, there are better ways. I believe there is a sticky thread about it in this (CSS) sub forum. Basically, you'll want to set height, or min-height (can't remeber), to 100%. This will make the div fill up its parent.

And as you may have already noticed, removing the javascript fixed your initial issue

Also, perhaps it's just me but I don't see why you'd place the left column with -100% left margin. Personally, I think this would be easier(?):
HTML Code:
<div id="content_wrapper">
   <div id="left_column">...</div>
   <div id="main_content">...</div>
   <div class="clear"></div>
</div>
Code:
#left_column { float: left; width: 150px; height: 100%; }
#main_content { float: left; height: 100%; }
.clear { clear: both; }
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.

Last edited by lizciz; 08-30-2011 at 01:04 AM..
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 08-30-2011, 02:08 PM Re: divs extend beyond container when window size decreased
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
lizciz, The sticky
http://tycoontalk.freelancer.com/css...l-browser.html
Shows how to make a div fill the browser view port. I need matching columns. I am optimistic about solving matching columns requirement with css. But I think I need another solution than Div 100% - Create pages that fill the browser window. Do you agree?
matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
Old 08-30-2011, 03:29 PM Re: divs extend beyond container when window size decreased
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Here's a small quote from the stickied link. I marked parts of the text with bold.

In this tutorial, you will learn the basic CSS technique for making pages fill the browser window, which you can also use any time you have a div that you want to stretch to fill its parent.

I still think you should give it a go
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 08-31-2011, 03:07 PM Re: divs extend beyond container when window size decreased
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
lizciz,
I went ahead with the "pages that fill browser" tutorial. I still can't get it to work. I have included an additional page with formatting more like you suggested, on which I cannot get it to even columns either.


http://thesweetwatercabin.com/photos_alt.html

http://thesweetwatercabin.com/test.html

tutorial:
http://www.communitymx.com/content/a...ge=1&cid=BAD95

Thank you for your help.
matt
matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
Old 08-31-2011, 04:12 PM Re: divs extend beyond container when window size decreased
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
I've looked it over a bit, but I've got an early morning so I can't look more into it right now.
Add min-height: 100%; to your #maincontainer, I think that should lead you on the right track.
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 09-01-2011, 02:44 PM Re: divs extend beyond container when window size decreased
matt w's Avatar
Super Talker

Posts: 136
Location: kalamazoo
Trades: 0
It didn't effect the layout.
matt w is offline
Reply With Quote
View Public Profile Visit matt w's homepage!
 
Reply     « Reply to divs extend beyond container when window size decreased
 

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