Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

HTML - How to avoid the space on the right and bottom side of an image in Internet Explorer

 
Thread Tools Search this Thread
Old 06-15-2006, 03:50 PM   #1
Default How to avoid the space on the right and bottom side of an image in Internet Explorer


Opera and Mozilla draw the border of the cells of the table just after the
picture. With Internet Explorer I do always have a small space.
If you select the image with the mouse you'll see that there's somehow a
small space on the right and bottom side of an image in Internet Explorer.

<table width = "100%" cellSpacing = "0" cellPadding = "0" border = "1"
align = "center">
<tr>
<td>
<img src = "mypic.gif">
</td>
</tr>
<tr>
<td>
<img src = "mypic.gif">
</td>
</tr>
</table>

Does anybody know how to get rid of this annoying space?
Stefan




Stefan Mueller
  Reply With Quote
Old 06-15-2006, 04:00 PM   #2
Els
 
Posts: n/a
Default Re: How to avoid the space on the right and bottom side of an image in Internet Explorer

Stefan Mueller wrote:

> Opera and Mozilla draw the border of the cells of the table just after the
> picture. With Internet Explorer I do always have a small space.
> If you select the image with the mouse you'll see that there's somehow a
> small space on the right and bottom side of an image in Internet Explorer.


[snip layout table]

> Does anybody know how to get rid of this annoying space?


Add some CSS:
<img src="mypic.gif" alt="" style="display:block;">

Images are inline content, just like text. The space below the image
is the same space below text, to make room for descenders of letters
like g,j,p,q,y.

Above is inline CSS, but of course it's better to set that style in a
styleblock, or even better, in your stylesheet. By the fact that
you're using 1997 HTML like border="1" and align="center" as well as
tables for layout, I'm guessing you're not using CSS yet, so - quick
solution is inline CSS as per the example.

--
Els http://locusmeus.com/
  Reply With Quote
Old 06-15-2006, 10:08 PM   #3
PH
 
Posts: n/a
Default Re: How to avoid the space on the right and bottom side of an image in Internet Explorer

"Stefan Mueller" <seekware-remove-@yahoo.com> wrote in message news:e6rs4a$s1o$...
> Opera and Mozilla draw the border of the cells of the table just after the
> picture. With Internet Explorer I do always have a small space.
> If you select the image with the mouse you'll see that there's somehow a
> small space on the right and bottom side of an image in Internet Explorer.

---
> <td>
> <img src = "mypic.gif">
> </td>

---

Put the tags on the same line with no space:
<td><img src = "mypic.gif"></td>
^ ^
__________________________________

<table width = "100%" cellSpacing = "0" cellPadding = "0" border = "1"
align = "center">
<tr>
<td><img src = "mypic.gif"></td>
</tr>
<tr>
<td><img src = "mypic.gif"></td>
</tr>
</table>
__________________________________
--
Best Regards
Peter Heinzl
www.123-game.com


  Reply With Quote
Old 06-16-2006, 04:45 AM   #4
Neredbojias
 
Posts: n/a
Default Re: How to avoid the space on the right and bottom side of an image in Internet Explorer

To further the education of mankind, "Stefan Mueller"
<seekware-remove-@yahoo.com> vouchsafed:

> Opera and Mozilla draw the border of the cells of the table just after
> the picture. With Internet Explorer I do always have a small space.
> If you select the image with the mouse you'll see that there's somehow
> a small space on the right and bottom side of an image in Internet
> Explorer.
>
> <table width = "100%" cellSpacing = "0" cellPadding = "0" border =
> "1"
> align = "center">
> <tr>
> <td>
> <img src = "mypic.gif">
> </td>
> </tr>
> <tr>
> <td>
> <img src = "mypic.gif">
> </td>
> </tr>
> </table>
>
> Does anybody know how to get rid of this annoying space?
> Stefan


Style the container (in this case table or td) with any/all of the
following:

line-height:0px;
font-size:0px;
vertical-align:bottom;

and, as mentioned, you could try display:block; on the images.

--
Neredbojias
Infinity has its limits.
  Reply With Quote
Old 06-16-2006, 04:56 AM   #5
vijay.khambe@gmail.com
 
Posts: n/a
Default Re: How to avoid the space on the right and bottom side of an image in Internet Explorer

Hey a simple solution... just put a <br> after img src....
i.e.
<td>
<img src = "mypic.gif"><br>
</td>
thats it.. all space will be removed...


Neredbojias wrote:
> To further the education of mankind, "Stefan Mueller"
> <seekware-remove-@yahoo.com> vouchsafed:
>
> > Opera and Mozilla draw the border of the cells of the table just after
> > the picture. With Internet Explorer I do always have a small space.
> > If you select the image with the mouse you'll see that there's somehow
> > a small space on the right and bottom side of an image in Internet
> > Explorer.
> >
> > <table width = "100%" cellSpacing = "0" cellPadding = "0" border =
> > "1"
> > align = "center">
> > <tr>
> > <td>
> > <img src = "mypic.gif">
> > </td>
> > </tr>
> > <tr>
> > <td>
> > <img src = "mypic.gif">
> > </td>
> > </tr>
> > </table>
> >
> > Does anybody know how to get rid of this annoying space?
> > Stefan

>
> Style the container (in this case table or td) with any/all of the
> following:
>
> line-height:0px;
> font-size:0px;
> vertical-align:bottom;
>
> and, as mentioned, you could try display:block; on the images.
>
> --
> Neredbojias
> Infinity has its limits.


  Reply With Quote
Old 06-16-2006, 08:07 AM   #6
Stefan Mueller
 
Posts: n/a
Default Re: How to avoid the space on the right and bottom side of an image in Internet Explorer

To use
<td><img src = "mypic.gif"></td>
instead of
<td>
<img src = "mypic.gif">
</td>
solves the problem.

However, I prefer
<img src="mypic.gif" alt="" style="display:block;">

The inline style
style="display:block;"
also solves my spacing problems I had with HREFs.


Many thanks to all
Stefan


  Reply With Quote
Old 07-05-2006, 08:55 AM   #7
Stefan Mueller
 
Posts: n/a
Default Re: How to avoid the space on the right and bottom side of an image in Internet Explorer

In the meantime a found a displaying issue while using style =
"display:block".

If I use
<table width = "100%">
<tr>
<td align = "center">
<a href = "private.php?do=newpm&u="></a>
</td>
</tr>
</table>
and then press the Tab key, '' gets surrounded (only
'' gets surrounded).

If I use
<table width = "100%">
<tr>
<td align = "center">
<a href = "private.php?do=newpm&u=" style =
"display:block"></a>
</td>
</tr>
</table>
and then press the Tab key, '' gets also surrounded but not
only ''. The whole row gets surrounded.

Is there any possibility to keep only '' surrounded even if I
use style = "display:block"?
Stefan


  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump