Forum Moderators: not2easy
To demonstrate the problem I have made the next example. Just make the window smaller and bigger to see the text jump down and up. Any way to fix this?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>White-Space Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style>
body {
font-family: arial, sans-serif;
font-size: 11pt;
}
table {
border: 2px solid green;
width: 50%;
}
td {
border: 1px solid red;
width: 100%;
white-space: nowrap;
}
div.Image {
float: left;
}
div.Text {
white-space: nowrap;
margin-left: 60px;
}
</style>
</head>
<body>
<table>
<tr>
<td>
<div class="Image">
<img src="back.gif" width="50" height="50" alt="image" border="1"/>
</div>
<div class="Text">
text text text text text text
</div>
</td>
</tr>
</table>
</body>
</html>
have a look at this and tell me if it's what you wanted to achieve.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>White-Space Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style>
body {
font-family: arial, sans-serif;
font-size: 11pt;
}
table {
border: 2px solid green;
width: 50%;
}
td {
border: 1px solid red;
width: 100%;
}
img.imagefloatleft {
float: left;
margin: 0 5px 0 0
}
</style>
</head>
<body>
<table>
<tr>
<td>
<img src="back.gif" width="50" height="50" alt="image" border="1" class="imagefloatleft"/>
text text text text text text
</td>
</tr>
</table>
</body>
</html>
you don't have to create divs to apply the styles - in your case I simplified the code by putting the image and text together and just applying some style to the image.
I also removed the nowrap from the td as I think that's what cause the pb in IE
hope this helps.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>White-Space Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style>
body {
font-family: arial, sans-serif;
font-size: 11pt;
}
table {
border: 2px solid green;
width: 50%;
}
td {
border: 1px solid red;
width: 100%;
}
img.imagefloatleft {
float: left;
margin: 0 5px 0 0
}
p.nowrap{
white-space: nowrap;
margin:0;
padding:0;
}
</style>
</head>
<body>
<table>
<tr>
<td>
<p class="nowrap"><img src="back.gif" width="50" height="50" alt="image" border="1" class="imagefloatleft"/>
text text text text text text</p>
</td>
</tr>
</table>
</body>
</html>