Basic query

Discussion in 'HTML' started by Brian Tozer, Oct 4, 2003.

  1. Brian Tozer

    Brian Tozer Guest

    In the following situation why would there be a narrow band of the
    background colour appearing above the graphic, and a wider/thicker/taller
    band appearing below it.
    I know how to handle the situation with CSS but would like to know why this
    situation exists.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title></title>
    </head>

    <body>
    <table width="100%">
    <tr>
    <td bgcolor="red">
    <img src="foo.gif">
    </td>
    </tr>
    </table>
    </body>
    </html>

    Thanks
    Brian Tozer
    Brian Tozer, Oct 4, 2003
    #1
    1. Advertising

  2. In article <blnd25$a9s$>, says...
    > In the following situation why would there be a narrow band of the
    > background colour appearing above the graphic, and a wider/thicker/taller
    > band appearing below it.
    > I know how to handle the situation with CSS but would like to know why this
    > situation exists.
    >
    > <td bgcolor="red">
    > <img src="foo.gif">
    > </td>


    There's whitespace. Try this:
    <td bgcolor="red"><img src="foo.gif"></td>

    --
    Hywel I do not eat quiche
    http://hyweljenkins.co.uk/
    http://hyweljenkins.co.uk/mfaq.php
    Hywel Jenkins, Oct 4, 2003
    #2
    1. Advertising

  3. Brian Tozer

    Brian Tozer Guest

    "Hywel Jenkins" wrote
    > says...


    > > In the following situation why would there be a narrow band of the
    > > background colour appearing above the graphic, and a

    wider/thicker/taller
    > > band appearing below it.
    > > I know how to handle the situation with CSS but would like to know why

    this
    > > situation exists.
    > >
    > > <td bgcolor="red">
    > > <img src="foo.gif">
    > > </td>


    > There's whitespace. Try this:
    > <td bgcolor="red"><img src="foo.gif"></td>


    Aha! Many thanks.
    I now have what looks like a few pixel width of border of the background
    colour showing above and below the graphic, which I have been unable to
    eliminate.
    I have implemented what must be overkill to try and eliminate this border.
    To no avail.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title></title>
    <style type="text/css">
    <!--
    body {
    margin: 0px;
    padding: 0px;
    }

    ..noborder {
    border: 0px;
    margin: 0px;
    padding: 0px;
    }

    ..table1 {
    width: 500px;
    background-color: red;
    border: 0px;
    padding: 0px;
    margin: 0px;
    }

    -->
    </style>
    </head>

    <body>
    <table class="table1">
    <tr>
    <td class="noborder"><div class="noborder"><img class="noborder"
    src="foo.gif" width="410" height="54"></div></td>
    </tr>
    </table>
    </body>
    </html>

    Thanks
    Brian Tozer
    Brian Tozer, Oct 5, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    6
    Views:
    3,365
    Steven Cheng[MSFT]
    Jun 29, 2005
  2. KiwiBrian

    Basic CSS query

    KiwiBrian, Jul 11, 2003, in forum: HTML
    Replies:
    4
    Views:
    494
    Leif K-Brooks
    Jul 12, 2003
  3. KiwiBrian

    Basic query

    KiwiBrian, Oct 30, 2004, in forum: HTML
    Replies:
    16
    Views:
    787
    KiwiBrian
    Oct 30, 2004
  4. Engineer
    Replies:
    6
    Views:
    612
    Jeremy Bowers
    May 1, 2005
  5. Replies:
    0
    Views:
    428
Loading...

Share This Page