CodeIgniter Forums
CSS Right float issue - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CSS Right float issue (/showthread.php?tid=10781)



CSS Right float issue - El Forum - 08-12-2008

[eluser]Yash[/eluser]
Hi,

I've created a template in which I set right div as float:right

now problem is if main div(on left hand size) is small then this right one starts floating on footer and on base...looks very ugly.
footer is just down of main.

looks ok if size of left is greater than right.complex?may be...

How can I resolve this issue?


CSS Right float issue - El Forum - 08-12-2008

[eluser]mdowns[/eluser]
It's hard to say without seeing the markup, but it sounds like you need to give the main div an explicit width and/or float:left.


CSS Right float issue - El Forum - 08-12-2008

[eluser]Yash[/eluser]
I use table instead of two div anyways thanx


CSS Right float issue - El Forum - 08-12-2008

[eluser]Matthew Lanham[/eluser]
Floating css is a bit of a paid, i'd suggest you have a look at a CSS framework, cuts down alot of crap Smile i've been using BlueprintCSS:

http://code.google.com/p/blueprintcss/


CSS Right float issue - El Forum - 08-12-2008

[eluser]shaffick[/eluser]
Try www.pmob.co.uk

A lot of css bases you can reuse.


CSS Right float issue - El Forum - 08-12-2008

[eluser]Yash[/eluser]
Thank you guys for your suggestion. I'll try these.


CSS Right float issue - El Forum - 08-13-2008

[eluser]Bramme[/eluser]
Don't forget to clear your floats Wink

That's probably the problem...


CSS Right float issue - El Forum - 08-13-2008

[eluser]Yash[/eluser]
what is that clear and how to use that? I can Google it but want to know developer view


CSS Right float issue - El Forum - 08-14-2008

[eluser]Bramme[/eluser]
when you float block elements other elements can't know the height of them. For instance, if you have a div containing two other divs, one floated left and the other right, the containing div will never span those two divs unless you clear them...

Lemme set up a quick example: http://bramme.net/uploads/float.htm