[thelist] Image Horizontal Alignment with CSS...

Mark Howells mark at mark.ac
Tue Dec 9 10:36:43 CST 2003


> <table width="300" border="1" cellspacing="0" cellpadding="0">
>   <tr>
>     <td width="1"><img src="/images/spacer.gif" width="1" 
> height="150"></td>
>     <td><div id='UserContentSpace' name='_203'><img height="299" 
> hspace="0"
>          src="/images/image.jpg" width="201" align="middle">
>         </div>
>     </td>
>   </tr>
> </table>

I doubt that using "center" will help you here.  The following things 
spring immediately to mind.

- Does IE recognize the single quotes around the ID attribute in the 
HTML?
- Try removing the align attribute from the HTML: that's what CSS is 
for.  The browser may get confused if you have two definitions.  75% of 
all unexplainable CSS bugs are down to incorrect, invalid or illogical 
source code.
- You don't say which version of IE you are having problems with.  
Maybe the combination of browser and platform has a problem with your 
definitions.
- Check all your alignment and margin settings for <img>, <div> and 
<td>.  There may be a conflict there somewhere.
- Do you really need to use a table to contain the layout?

Mark Howells
http://www.mark.ac/



More information about the thelist mailing list