By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,529 Members | 1,860 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,529 IT Pros & Developers. It's quick & easy.

img-elements with align-attribute do not break in ie7

P: n/a
Strange behaviour in ie7.

A collegue of mine put several images into a page using JCE in Joomla.
JCE have the option to align these images and he left aligned every
single one - to create a string of images.

In Firefox these img-elements breaked when then reached the border of
the sorrounding div-element, i ie7 they continued. I removed the align-
attribute and everything looking the same in both browsers. I haven't
tested in ie6.

Tor

Apr 7 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 2007-04-07, torbs <to********@gmail.comwrote:
Strange behaviour in ie7.

A collegue of mine put several images into a page using JCE in Joomla.
JCE have the option to align these images and he left aligned every
single one - to create a string of images.

In Firefox these img-elements breaked when then reached the border of
the sorrounding div-element, i ie7 they continued. I removed the align-
attribute and everything looking the same in both browsers. I haven't
tested in ie6.
Setting align="left" on an img in a modern browser is interpreted as
style="float: left", as is setting align="left" on a table.

But, in quirks mode on Firefox, if you set align="left" rather than
style="float: left" on a table, it doesn't behave quite like a float
after all: a series of them next to each other will not break into
"lines" as floats would, but will stay next to each other and overflow
the container horizontally. This is a special quirk put into Firefox to
provide compatibility with the behaviour of some version of IE which did
that.

In strict mode on Firefox, align="left" on a table behaves just the same
as style="float: left".

I don't know if Firefox also applies this quirk to inline images with
align="left" in quirks mode as well as to tables. Perhaps not based on
what you're seeing, but then I don't know what DOCTYPE you have.

If you remove the align attribute, the images aren't floated any more,
but are inline. A series of inline boxes also gets broken to fit onto
lines, in a way that's similar to a series of floats.

So just don't bother with align="left" if the only things in the block
are these images. Otherwise, use style="float: left" instead.
Apr 7 '07 #2

P: n/a
On Apr 7, 8:10 pm, Ben C <spams...@spam.eggswrote:
On 2007-04-07, torbs <torches...@gmail.comwrote:
Strange behaviour in ie7.
A collegue of mine put several images into a page using JCE in Joomla.
JCE have the option to align these images and he left aligned every
single one - to create a string of images.
In Firefox these img-elements breaked when then reached the border of
the sorrounding div-element, i ie7 they continued. I removed the align-
attribute and everything looking the same in both browsers. I haven't
tested in ie6.

Setting align="left" on an img in a modern browser is interpreted as
style="float: left", as is setting align="left" on a table.

But, in quirks mode on Firefox, if you set align="left" rather than
style="float: left" on a table, it doesn't behave quite like a float
after all: a series of them next to each other will not break into
"lines" as floats would, but will stay next to each other and overflow
the container horizontally. This is a special quirk put into Firefox to
provide compatibility with the behaviour of some version of IE which did
that.

In strict mode on Firefox, align="left" on a table behaves just the same
as style="float: left".

I don't know if Firefox also applies this quirk to inline images with
align="left" in quirks mode as well as to tables. Perhaps not based on
what you're seeing, but then I don't know what DOCTYPE you have.

If you remove the align attribute, the images aren't floated any more,
but are inline. A series of inline boxes also gets broken to fit onto
lines, in a way that's similar to a series of floats.

So just don't bother with align="left" if the only things in the block
are these images. Otherwise, use style="float: left" instead.
I use xhtml 1.0 transitional. The fun thing is that everything looked
ok when I floated it to left in ie - nothing changed in firefox.
Firefox look ed good - as always. I don't think I am in quirks mode. I
have applied a correct doctype. Perhaps I shouls check the compat...

Apr 7 '07 #3

P: n/a
On 2007-04-07, torbs <to********@gmail.comwrote:
On Apr 7, 8:10 pm, Ben C <spams...@spam.eggswrote:
>On 2007-04-07, torbs <torches...@gmail.comwrote:
Strange behaviour in ie7.
A collegue of mine put several images into a page using JCE in Joomla.
JCE have the option to align these images and he left aligned every
single one - to create a string of images.
In Firefox these img-elements breaked when then reached the border of
the sorrounding div-element, i ie7 they continued. I removed the align-
attribute and everything looking the same in both browsers. I haven't
tested in ie6.

Setting align="left" on an img in a modern browser is interpreted as
style="float: left", as is setting align="left" on a table.

But, in quirks mode on Firefox, if you set align="left" rather than
style="float: left" on a table, it doesn't behave quite like a float
after all: a series of them next to each other will not break into
"lines" as floats would, but will stay next to each other and overflow
the container horizontally. This is a special quirk put into Firefox to
provide compatibility with the behaviour of some version of IE which did
that.

In strict mode on Firefox, align="left" on a table behaves just the same
as style="float: left".

I don't know if Firefox also applies this quirk to inline images with
align="left" in quirks mode as well as to tables. Perhaps not based on
what you're seeing, but then I don't know what DOCTYPE you have.

If you remove the align attribute, the images aren't floated any more,
but are inline. A series of inline boxes also gets broken to fit onto
lines, in a way that's similar to a series of floats.

So just don't bother with align="left" if the only things in the block
are these images. Otherwise, use style="float: left" instead.

I use xhtml 1.0 transitional. The fun thing is that everything looked
ok when I floated it to left in ie - nothing changed in firefox.
Firefox look ed good - as always. I don't think I am in quirks mode. I
have applied a correct doctype. Perhaps I shouls check the compat...
I just tested this, and it seems FF doesn't apply this quirk to images,
only to tables.

I think that non-wrapping is an IE quirk that Mozilla replicated for
tables in Firefox, but not for img.

You probably are putting IE into some kind of quirks mode with that
DOCTYPE.

But anyway, better to use float rather than align if that's what you
want.
Apr 7 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.