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
CSS unlimited horizontal scroll??
Old 04-22-2009, 12:49 PM CSS unlimited horizontal scroll??
Junior Talker

Posts: 2
Trades: 0
I have a collection of floating divs contained inside a container div. The floating divs are generated dynamically so they could number from one to whatever. The problem I'm having is that when there are too many floating divs, the container elements width is exceeded and the remaing floating divs display below the rest.

How can i make the container div expand infinitely depending on it's content? I tried using the overflow properties but didn't have any luck plus such a solution looks ugly in my app.

Thanks for any help you can give me.

Quote:
#container { background: #E7E7E7; position:absolute; left:0px; top:380px; width: 100%; height: auto; float: left;}

.floatingDivs {width: auto; float: left; padding: 0px;}
squariegoes is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-22-2009, 03:26 PM Re: CSS unlimited horizontal scroll??
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
You can't float an absolutely positioned div, the two are diametrically opposed. Float it and leave off the absolute - you don't need it. However, if you float a div, you have to give it a dimension, so, if the #container is taking up the entire width of the screen, you don't need to float it either, it will go from left to right by default.

The width:auto is pretty useless because the NORMAL behavior for a div is to stretch with it's content.

Are these dynamically generated floating divs given dimensions when they are created ?
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 04-22-2009, 03:47 PM Re: CSS unlimited horizontal scroll??
Junior Talker

Posts: 2
Trades: 0
I posted in another and have solved the issue -
http://www.sitepoint.com/forums/show...39#post4231239
squariegoes is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to CSS unlimited horizontal scroll??
 

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