C
Ciaran
I've come across this small annoying problem many times but never
managed to figure out a satisfactory solution.
It's incredibly simple: an element that is floated right which has
inline content in before it looks different in every browser.
In the past, all browsers rendered the floated element down a line
which meant a negative margin-top would fix the problem but the latest
version of firefox and chrome (correctly) display the floated content
on the same line as the rest of the inline stuff.
I've found one workaround: putting the floated element before the
inline content correctly renders it in the right spot but I'd prefer
to keep the HTML clean and fix this with CSS. Any Ideas?
Look at this in FF and then IE and you'll see what I mean:
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head></head>
<body>
Some inline content<div style="float:right">floated right!</div>
</body>
</html>
managed to figure out a satisfactory solution.
It's incredibly simple: an element that is floated right which has
inline content in before it looks different in every browser.
In the past, all browsers rendered the floated element down a line
which meant a negative margin-top would fix the problem but the latest
version of firefox and chrome (correctly) display the floated content
on the same line as the rest of the inline stuff.
I've found one workaround: putting the floated element before the
inline content correctly renders it in the right spot but I'd prefer
to keep the HTML clean and fix this with CSS. Any Ideas?
Look at this in FF and then IE and you'll see what I mean:
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head></head>
<body>
Some inline content<div style="float:right">floated right!</div>
</body>
</html>