hackalive Posted April 1, 2012 Share Posted April 1, 2012 Hi guys, I have the following code: CSS * { margin: 0 0 0 0; } body, html { overflow: hidden; } #container { } #setA { float: left; display: inline-block; margin-left: 0.75in; } #setB { float: left; display: inline-block; margin-left: 0.75in; } #setC { float: left; display: inline-block; margin-left: 0.75in; } .item { background: blue; width: 500px; height: 500px; } PHP <div id="container"> <div id="setA"> <div class="item"></div> </div> <div id="setB"> <div class="item"></div> </div> <div id="setC"> <div class="item"></div> </div> </div> On my screen "SetC" goes onto a new line and does not overflow the screen horizontally (and then need to scroll to see it) like it should. How can I fix this? Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted April 1, 2012 Share Posted April 1, 2012 this has to do with the width of #container; http://jsfiddle.net/9LsEs/1/ Quote Link to comment Share on other sites More sharing options...
hackalive Posted April 1, 2012 Author Share Posted April 1, 2012 Thanks for your reply, however what if I don't know the width as a number? Im placing two jQuery isotope instances side by side so I have no idea what the overflow is. Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted April 2, 2012 Share Posted April 2, 2012 Thanks for your reply, however what if I don't know the width as a number? Im placing two jQuery isotope instances side by side so I have no idea what the overflow is. need to have a fixed width set. Quote Link to comment Share on other sites More sharing options...
hackalive Posted April 2, 2012 Author Share Posted April 2, 2012 Well there is no way to tell that. How about jquery appending the CSS? Quote Link to comment Share on other sites More sharing options...
AyKay47 Posted April 2, 2012 Share Posted April 2, 2012 you would have to calculate the width needed and set that to #container using something like JS yes. Quote Link to comment Share on other sites More sharing options...
hackalive Posted April 2, 2012 Author Share Posted April 2, 2012 How can I calculate the width needed? Or how can I place two instances of isotope in the same div to get out of this issue? (or is there some other jquery/css way out of this? how do they do it with the HTML5 presentation apps?) Quote Link to comment Share on other sites More sharing options...
hackalive Posted April 6, 2012 Author Share Posted April 6, 2012 bump Quote Link to comment Share on other sites More sharing options...
hackalive Posted April 21, 2012 Author Share Posted April 21, 2012 bump Quote Link to comment Share on other sites More sharing options...
hackalive Posted April 28, 2012 Author Share Posted April 28, 2012 bump Quote Link to comment Share on other sites More sharing options...
White_Lily Posted August 29, 2012 Share Posted August 29, 2012 Setting a width in CSS is simple: width:230px; change "230" to suite the container width, to judge this just up the number until they are all how you want them. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.