Forum Moderators: not2easy

Message Too Old, No Replies

To float or not to float

Should I float the image or use a table?

         

TheDave

6:11 am on Aug 18, 2003 (gmt 0)

10+ Year Member



I'm currently using "float: left; clear:left" on a few images around some paragraphs, and it's working all good in all the browsers I have tested, but is there any negative effects to using this? I'm just really sceptical of this effect for some reason.

tedster

6:16 am on Aug 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



float: is very dependable in my experience. Probably because it does the same thing as align= used to do, there was no need to develop lots of new routines to handle it. Whatever the reason, have no worry.

TheDave

6:25 am on Aug 18, 2003 (gmt 0)

10+ Year Member



Ok, thanks :) I think it's just because I rarely see it used that I'm sceptical.

DrDoc

2:40 pm on Aug 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It depends on what you're floating. Images are usually safe... Floating divs can trigger bugs in the crappy IE browser.

TheDoctor

8:28 pm on Aug 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I tend to make floating images invisible to NN4, since I've seen some problems there - but that's just me.

<edit>I mean I make them not float in NN4, not that I float them but make them invisible! It's been a long day</edit>

Purple Martin

11:59 pm on Aug 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I didn't think float and clear were supposed to be used on the same element?

Look at this topic for more info:
[webmasterworld.com...]

TheDave

2:48 am on Aug 19, 2003 (gmt 0)

10+ Year Member



You're correct Purple Martin, thanks :) Hasn't caused me any problems yet, but I'll fix it up :) The clear probably doesnt even need to be there now I think about it, I just added it for good measure.

DrDoc

2:29 pm on Aug 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sure you can use clear and float together!

[w3.org...]

This property may only be specified for block-level elements (including floats)

Say that you have two images. You want both floated to the left, but not next to each other. They should be stacked. Now, the best way to accomplish this is using "clear:left" on the second image.

Sure, an image is an inline element, but not when it's floated:

Any floated box becomes a block box that is shifted to the left or right until its outer edge touches the containing block edge or the outer edge of another float.

fungku

5:13 pm on Aug 19, 2003 (gmt 0)

10+ Year Member



DrDoc -- 10:40 am on Aug. 18, 2003 (utc -4)
"It depends on what you're floating. Images are usually safe... Floating divs can trigger bugs in the crappy IE browser."

That's for sure =(

I'm having problems with that right now.