Forum Moderators: not2easy

Message Too Old, No Replies

Probably something simple

IE Issues

         

Shaker

7:14 am on Feb 25, 2006 (gmt 0)

10+ Year Member



I want to be able to have the text float up the top in IE, like it does in Firefox. For some reason, the text in IE sits under the ImageTable? I'd post the code, but it's lengthy and I'm not sure where I should be looking? Am I'm missing a align top(?) or something in the "Txt" or "Main" parts?

I'd also like to be able to do the following two rowed table, the one with the Image and caption in CSS:


<table cellpadding="0" cellspacing="0" class="ImageTable" align="left">
<div id ="Image">
<tr>
<td><IMG SRC="image.jpg" border="0"></td>
<tr>
<td class="Caption">Image Caption: Caption</td>
</tr>
</div>
</table>

Is this possible? I'd also like to have it so that the "Image Caption" text does not expand the background.

[edited by: SuzyUK at 8:31 am (utc) on Feb. 25, 2006]
[edit reason] ooops sorry no URLs : see TOS #13 [WebmasterWorld.com] [/edit]

Shaker

8:52 am on Feb 25, 2006 (gmt 0)

10+ Year Member



Full code!


<html>
<style>
.Heading {
font-family: Arial, Helvetica, sans-serif;
font-size: 18px;
line-height: 20px;
color: #FF0000;
margin: 3px 100px 3px 3px;
border-bottom-color: #000000;
}

#Image {
float:left;
overflow:hidden;
}

table.ImageTable {
vertical-align: top;
background-color: #00ff00;
padding: 1px; margin: 3px 3px 3px 10px;
}

#Main {
overflow:hidden;
overflow-x: auto;
overflow-y: auto;
padding-top: 0px;
border: 1px solid #000000;
}

.Txt {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
text-align:justify;
line-height: 16px;
color: #000000;
margin: 3px 10px 3px 10px;
}

A.Txt:link, A.Txt:visited {
color: #000000;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
text-decoration: none;
}

A.Txt:hover {
color: #000000;
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
text-decoration: underline;
}
.Caption {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
}
</style>
<body>

<div id="Main">
<p class="Heading">This is a title!</p>
<table cellpadding="0" cellspacing="0" class="ImageTable" align="left">
<div id ="Image">
<tr>
<td><IMG SRC="image.jpg" border="0"></td>

<tr>
<td class="Caption">Image Caption: Caption</td>
</tr>
</div>
</table>
<p class="Txt">
Exttay otay ogay intoway eildfay illway otnay akemay anyway ensesay. Illfay exttay erehay. Isthay isway erewhay ethay illfay entencessay illway ogay, extnay otay ethay imageway onway ethay
eftlay otnay overway owingflay.<br /><br />
</p>

</div>

<br>

<div id="Main">
<p class="Heading">This is a title!</p>
<table cellpadding="0" cellspacing="0" class="ImageTable" align="left" width="100">
<div id ="Image">
<tr>
<td><IMG SRC="image.jpg" border="0"></td>

<tr>
<td class="Caption">Image Caption: Caption text does not overflow cell</td>
</tr>
</div>
</table>
<p class="Txt">
Exttay otay ogay intoway eildfay illway otnay akemay anyway ensesay. Illfay exttay erehay. Isthay isway erewhay ethay illfay entencessay illway ogay, extnay otay ethay imageway onway ethay
eftlay otnay overway owingflay.<br /><br />
</p>

</div>
</body>
</html>

SuzyUK

9:15 am on Feb 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Shaker and Welcome to WebmasterWorld!

first off trying to get the caption to display beside the image is easy it's just an HTML problem don't know whether it's a typo or you're unfamiliar with coding tables?
if the former remove the

<tr>
before the
<td class="Caption"...>

if the latter validating the html [validator.w3.org] would've helped spot that the table row elements were not properly closed (FF was just interpreting the error differently than IE)

I'd also like to be able to do the following two rowed table, the one with the Image and caption in CSS:

The table does not need to have two rows, it needs to have 1 row and two columns, also are you aware that align="left" on a table makes it act like it is floated left?

to do the same in CSS you could use internal floats, something like

<div class="image-caption">
<img src..>
<div class="caption">your caption here</div>
</div>

.image-caption {float: left; width: 100%;}
.image-caption img {float: left; width: 100px;}
.caption {}

Suzy

Shaker

9:46 am on Feb 25, 2006 (gmt 0)

10+ Year Member



Hello Suzi.

I have changed the code:

 <div id="Main">
<p class="Heading">This is a title!</p>
<table cellpadding="0" cellspacing="0" class="ImageTable" align="left" width="100">
<div id ="Image">
<tr>
<td><IMG SRC="image.jpg" border="0"></td>

<tr>
<td class="Caption">Image Caption: Caption text does not overflow cell</td>
</tr>
</div>
</table>
<p class="Txt">
Exttay otay ogay intoway eildfay illway otnay akemay anyway ensesay. Illfay exttay erehay. Isthay isway erewhay ethay illfay entencessay illway ogay, extnay otay ethay imageway onway ethay
eftlay otnay overway owingflay.<br /><br />
</p>

</div>


To the following:


<div id="Main">
<p class="Heading">This is a title!</p>
<div id ="Image">
<table cellpadding="0" cellspacing="0" class="ImageTable" align="left" width="100">
<tr>
<td><IMG SRC="image.jpg" border="0"></td>
<tr>
<td class="Caption">Image Caption: Caption text does not overflow cell</td>
</tr>
</table>
</div>
<p class="Txt">
Exttay otay ogay intoway eildfay illway otnay akemay anyway ensesay. Illfay exttay erehay. Isthay isway erewhay ethay illfay entencessay illway ogay, extnay otay ethay imageway onway ethay
eftlay otnay overway owingflay.<br /><br />
</p>
</div>

The text lines up to the top in IE next to the image div, but it over flows the border of the Main div and into the next Main after that?

I tried the CSS image caption as well but the Caption appeared alongside the image, not underneath it.

SuzyUK

10:18 am on Feb 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Shaker, I'm still not quite sure what you're trying to do here.. and there's still a rogue <tr>

but anyway are you looking to do someting like this? (I've added borders and cell numbers to try and make this easier)

<table cellpadding="0" cellspacing="0" border="1" class="ImageTable" align="left" width="100%">
<tr>
<td style="text-align: center;"><IMG SRC="image.jpg" border="0"><br />
Image Caption: CELL 1</td>
<td class="Txt">
CELL 2 <br>
Exttay otay ogay intoway eildfay illway otnay akemay anyway ensesay. Illfay exttay erehay. Isthay isway erewhay ethay illfay entencessay illway ogay, extnay otay ethay imageway onway ethay
eftlay otnay overway owingflay.</td>
</tr>
</table>

i.e. do you want the caption underneath the image in CELL 1 and the Text alongside both in CELL2?

Shaker

10:39 am on Feb 25, 2006 (gmt 0)

10+ Year Member



That's it! With the text in cell 2 to be aligned to the top and wrapped around cell 1, Ie: if it goes further than the image to wrap underneath it.

SuzyUK

11:32 am on Feb 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK.. well that's going to be easier with CSS than a table ;) I have to go out right now so very quickly..

<div class="imageandtext" style="background: #eee;">

<div class="imageandcaption" style="float: left; margin: 0 10px 10px 0">
<IMG SRC="image.jpg" border="0" width="60" height="100">
<br>caption here
</div>

<p>Exttay otay ogay intoway eildfay illway otnay akemay anyway ensesay. Illfay exttay erehay. Isthay isway erewhay ethay illfay entencessay illway ogay, extnay otay ethay imageway onway ethay
eftlay otnay overway owingflay.</p>
<p>Exttay otay ogay intoway eildfay illway otnay akemay anyway ensesay.</p>

<br style="clear: both">

</div>

the "imageandcaption" div is floated to the left, you can margin around it as necessary and the <p>aragraphs of text will automatically do what you want.

The clear: both <br> is just a safety thing in case the image is longer than the text, a div like "imageandtext" (colored grey) will not stretch vertically to contain a floated element unless you give it some sort of special instruction to do so and this is the quickest one I could think of just now!

anyway see how you get on!
Good Luck
Suzy

Shaker

12:47 pm on Feb 25, 2006 (gmt 0)

10+ Year Member



Thanks Suzy, that works. But in IE I still have the problem of the Caption going over the "imageandtext" div.

:/