Forum Moderators: open
Take a look in FF and you will see how I would like it to appear in IE. Thanks!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><title></title>
<style type="text/css">
.floatbox {
width:120px;
height:80px;
float:right;
margin-left:10px;
background:#cccccc;
}
</style>
</head><body><center>
<table><tr><td><div class="floatbox"></div>
<li> Lorem ipsum dolor sit amet<br>
<li> Duis autem vel eum<br>
<li> Duis feugait nulla facilisi<br>
<li> Vel illum dolore eu feugiat</td></tr></table>
</center></body>
</html>
<ul>
<li>Lorem ipsum dolor sit amet</li>
<li>Duis autem vel eum</li>
<li>Duis feugait nulla facilisi</li>
<li>Vel illum dolore eu feugiat</li>
</ul>
It now displays differently in FF (and IE), because of the margin/padding on the UL - although not as you require.
I cannot specify a width on the outer table because the text will be dynamic and vary in length.
My gut reaction is you need to specify a width on something, and simply let the text flow down the page? But you want the text to expand the width, not just the length. You could try something like... (losing the table)...
<div class="outer">
<div class="floatbox"></div>
<div class="text">
<ul>
<li>Lorem ipsum dolor sit amet</li>
<li>Duis autem vel eum</li>
<li>Duis feugait nulla facilisi</li>
<li>Vel illum dolore eu feugiat</li>
</ul>
</div>
</div>
Additional CSS:
.text {
text-align:left;
float:right;
} But you're going to have problems centreing the 'outer' container without a width? Without a width set... the TABLE is not expanding enough to fit its contents (at least not enough to prevent wordwrap in IE); the DIV too much.
Thank you very much for your input penders. :)
I'll leave the following for anyone that might like to try and find a solution for this odd display problem.
Float right displays text poorly in IE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><title></title>
<style type="text/css">
.floatbox {
width:120px;
height:80px;
float:right;
margin-left:10px;
background:#cccccc;
}
</style>
</head><body><center>
<table><tr><td><div class="floatbox"></div>
Lorem ipsum dolor sit amet</td></tr></table>
</center></body>
</html>
Float left displays text correctly in IE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><title></title>
<style type="text/css">
.floatbox {
width:120px;
height:80px;
float:left;
margin-right:10px;
background:#cccccc;
}
</style>
</head><body><center>
<table><tr><td><div class="floatbox"></div>
Lorem ipsum dolor sit amet</td></tr></table>
</center></body>
</html>