correct way to use float ???

admin

Administrator
Staff member
Hi all !!!
After three hours getting mad with Opera, I finally discovered my problem was due to float... ( many thanks to Fang who tried to help me with the scrollbar problem ! )
I had two classes :

.left {
float: left;
}
.right {
float: right;
}


then, in my code, I had something like :

<div class="left">Login</div>
<div class="right">Stuff</div>
<div style="clear: both;"></div>


But when the thing was really at the bottom of the page, ( in a frame-like scrollable div ) it would bring an undesired scrollbar on the the main page in opera 7.5.
By removing those three lines, I managed to chase the scrollbar away.
But still, I liked the way it looked ( not the scrollbar ), and I'd like to know how I could do the same thing without bringing the ugly scrollbar back.

I'm VERY unfamiliar with floats, so if somebody could tell me a bit about them, and also tell me what was wrong with my code, I'd be extremely grateful...

Thanks a lot !!!
NessTo hide the scroll bar:

overflow: hidden;To hide the scroll bar:

overflow: hidden;
Hi Ulti !!!!
Thanks for the suggestion, but what about the people with a low screen resa ? :(
Otherwise, I'd have done it...
( but just realise that I wouldn't have spent 3 hours looking for a solution if I was satisfied with a simple overflow: hidden... I'm not THAT newbieish... ;) )
BTW, I suscribed to your brand new forum !!!Thanks for that, it should start growing within a short time.

People browing with either a very large screen or very small screen should be able to see your website the same in either case. The best way to do this is to avoid the pixel mesaurement and switch to the percentage mesasurement instead.
Your font sizes and your DIV,SPAN,LAYER,IMG, heights widths, etc should all be written in terms of percectage.Thanks for that, it should start growing within a short time.

People browing with either a very large screen or very small screen should be able to see your website the same in either case. The best way to do this is to avoid the pixel mesaurement and switch to the percentage mesasurement instead.
Your font sizes and your DIV,SPAN,LAYER,IMG, heights widths, etc should all be written in terms of percectage.
Arrrggghghhhhhh !!!!!!!! :eek:
How do I do such a thing ??????? :( :( :(
Do you have any quick solution for transforming all the images measures into percentages ?
I see one problem to that...
What if the user as an odd screen resa, like a panoramic screen ? How do I do it, so that the images are not stretched out horizontaly ?
You know my site, do you think it's possible to do something with percentages ? I've never used them, so I'm very unaware of how to do such things... If you could help me, please please please !!!! :)
BTW, you still heavn't told me how to use the float correctly... ;)In your example, you can replace:

<style type="text/css">

.left {
float: left;
}
.right {
float: right;
}
</style>
<div class="left">Login</div>
<div class="right">Stuff</div>
<div style="clear: both;"></div>

With:

<style type="text/css">

.left {
float: left;
}
.right {
position: relative;
left:89.8%;
top:0%;
}
</style>
<div class="left">Login</div>
<div class="right">Stuff</div>
<div style="clear: both;"></div>


However, the percentage approach is dependant on the width of the DIV. :(yeah, but the float element is not well supported in Opera... :(what forum?My forums:
<!-- m --><a class="postlink" href="http://s11.invisionfree.com/Web_Designers_Forums/index.php?act=idx">http://s11.invisionfree.com/Web_Designe ... hp?act=idx</a><!-- m -->
 
Back
Top