Results 1 to 16 of 16
Thread: CSS: float:left and right:0 ?
-
08-03-2014, 11:39 PM #1Disabled
- Join Date
- Apr 2010
- Posts
- 43
CSS: float:left and right:0 ?
Hi!
This is an extremely simple problem but the solution is pretty tricky.
I have a wrapper containing:
- A float:left with some text so I can't predict the width
- Another float:left that I want to extend to the right of the wrapper (a sort of right:0)
Is there any way to do this without the use of table?
Thanks!
-
08-04-2014, 03:52 AM #2Junior Guru Wannabe
- Join Date
- Jun 2013
- Posts
- 61
- SimpleCRM Coming Soon!
ModulesBakery - Custom Software & Front-End Development (PHP & MySQL OR Oracle Databases, Zend Framwork, Symfony).
-
08-04-2014, 08:42 AM #3Disabled
- Join Date
- Apr 2010
- Posts
- 43
-
08-04-2014, 09:00 AM #4Junior Guru Wannabe
- Join Date
- Jun 2013
- Posts
- 61
- SimpleCRM Coming Soon!
ModulesBakery - Custom Software & Front-End Development (PHP & MySQL OR Oracle Databases, Zend Framwork, Symfony).
-
08-04-2014, 10:03 AM #5Disabled
- Join Date
- Apr 2010
- Posts
- 43
QualityMarkup : do you really read threads on Web Hosting Talk or you just post to get some backlinks?
I see few relevant posts in your statistics/history.
Now people see replies on my topic and will think I had an answer...
If an admin can remove all our replies. THANKS!
-
08-04-2014, 10:31 AM #6Junior Guru Wannabe
- Join Date
- Jun 2013
- Posts
- 61
-
08-04-2014, 10:38 AM #7Retired Moderator
- Join Date
- May 2004
- Location
- Toronto, Canada
- Posts
- 5,105
I think he is just trying to help. If the post doesn't help you then just ignore it.
CloudNexus Technology Services
Managed Services
-
08-04-2014, 01:08 PM #8Disabled
- Join Date
- Apr 2010
- Posts
- 43
All right.
I'm sorry then, it just looked really irrelevant to me.
I apologize
-
08-04-2014, 03:32 PM #9WHT Addict
- Join Date
- May 2006
- Posts
- 109
Can you tell us more about what you're trying to achieve?
Here's a fiddle with what I think you've said so far:
http://jsfiddle.net/avibodha/MG8kL/
Does the text in the left div extend to push the right div down? Is that the problem?Last edited by avibodha; 08-04-2014 at 03:38 PM.
-
08-04-2014, 11:52 PM #10Disabled
- Join Date
- Apr 2010
- Posts
- 43
http://jsfiddle.net/MG8kL/3/
-> This is an updated version of your code (thank you!)
What I need is that the red box extends to the right so it sticks to the green border.
So the content in red does not matter, but the content in blue pushes red (which therefore becomes narrower)
As if red was float:left and right:0
IMO there is no other solution than a table, but...
-
08-05-2014, 02:46 AM #11Web Hosting Master
- Join Date
- Aug 2005
- Posts
- 3,587
how 'bout this:
http://jsfiddle.net/MG8kL/5/
-
08-05-2014, 04:17 AM #12Web Hosting Master
- Join Date
- May 2005
- Posts
- 1,141
Remove the float on the left one. And add the float right on the right one. The right div should come first.
http://jsfiddle.net/s8942/
If you are really looking for table like behavior... just make a table.I have no sig to spam.
-
08-05-2014, 04:39 AM #13Web Hosting Master
- Join Date
- Mar 2012
- Location
- United Kingdom
- Posts
- 1,136
★ Sapatana.eu ILoveBilling
★ 120Gbps DDoS Protection on Shared Hosting, Reseller Hosting, XEN Windows and Linux VPS, Domains, SSL Certificates
★ PayPal | BitPay (BitCoin) | UK Bank Transfer | International Bank Transfer
-
08-05-2014, 08:27 AM #14Disabled
- Join Date
- Apr 2010
- Posts
- 43
Thank you guys for the replies.
Ok that is not what I'm trying to do.
I need the left border of RED to stick with right border of BLUE, and right border of RED to still stick with GREEN border, then the size of both RED & BLUE are determined by the content in BLUE.
Yes, I guess that is unfortunately the only option.
After all there's no evil in table it's just a tag like another!
-
08-05-2014, 01:20 PM #15WHT Addict
- Join Date
- May 2006
- Posts
- 109
I think you just need to move the background to the wrapper then, like so:
http://jsfiddle.net/avibodha/MG8kL/6/
Or maybe there's more to it than that?
-
08-05-2014, 07:14 PM #16Disabled
- Join Date
- Apr 2010
- Posts
- 43
Similar Threads
-
css float issues
By christianstogether in forum Web Design and ContentReplies: 13Last Post: 05-15-2014, 06:51 PM -
how to image float left and bottom with text wrap?
By wetpwet in forum Web Design and ContentReplies: 1Last Post: 12-04-2013, 06:39 PM -
CSS - clear: both or float: none?
By mounty in forum Web Design and ContentReplies: 8Last Post: 04-11-2011, 11:26 PM -
CSS Float problems
By kendalbren in forum Web Design and ContentReplies: 5Last Post: 08-16-2009, 10:37 AM -
CSS Float Problem...
By Ryuumeiko in forum Web Design and ContentReplies: 3Last Post: 04-19-2005, 07:44 AM