Help with Border

Discussion in 'HTML' started by Keith Smith, May 10, 2005.

  1. Keith Smith

    Keith Smith Guest

    How come when I use the following code there is still some space around my
    picture? I need for my picture to touch the edges. (and, no, I don't want
    to just change my background image).

    Please help!

    <html>
    <body style="border:0px;border-collapse:collapse;" cellpadding="0"
    cellspacing="0">
    <img src="pic1.jpg" style="border:0px;border-collapse:collapse;"
    cellpadding="0" cellspacing="0">
    </body>
    </html>
    Keith Smith, May 10, 2005
    #1
    1. Advertising

  2. Keith Smith

    Adrienne Guest

    Gazing into my crystal ball I observed "Keith Smith"
    <> writing in news:5J5ge.23069$hh6.8587@trnddc01:

    > How come when I use the following code there is still some space around
    > my picture? I need for my picture to touch the edges. (and, no, I
    > don't want to just change my background image).
    >
    > Please help!
    >
    ><html>
    ><body style="border:0px;border-collapse:collapse;" cellpadding="0"
    > cellspacing="0"> <img src="pic1.jpg"
    > style="border:0px;border-collapse:collapse;" cellpadding="0"
    > cellspacing="0"> </body> </html>
    >
    >
    >


    You are using table markup for body and image elements. What you want is:

    <body style="margin:0">
    <img src="pic1.jpg" style="border:0">
    </body>

    Of course, it would be better to put this in an external stylesheet, eg:

    body {margin:0; padding:0 /*For Opera and others*/}
    img {border:0}

    Also, put a DocType at the top of the page, HTML 4.01 Strict should be used
    for new pages.

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne, May 10, 2005
    #2
    1. Advertising

  3. Keith Smith

    Keith Smith Guest


    > Also, put a DocType at the top of the page, HTML 4.01 Strict should be
    > used
    > for new pages.


    It worked great! But how do I do the doc-type part?
    Keith Smith, May 10, 2005
    #3
  4. > It worked great! But how do I do the doc-type part?

    See this great article at A List Apart:

    http://www.alistapart.com/articles/doctype/

    I recommend that you bookmark that site and spend some time looking around
    (and reading it!) it contains some absolute gems!

    Gareth J M Saunders
    Edinburgh, UK
    Gareth J M Saunders, May 10, 2005
    #4
  5. Keith Smith

    mbstevens Guest

    mbstevens, May 10, 2005
    #5
    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. tshad
    Replies:
    0
    Views:
    2,257
    tshad
    Jan 31, 2005
  2. Applebrown
    Replies:
    0
    Views:
    361
    Applebrown
    May 21, 2004
  3. phl
    Replies:
    1
    Views:
    4,346
    Martin Jay
    Jun 8, 2006
  4. Coder
    Replies:
    1
    Views:
    696
    Cowboy \(Gregory A. Beamer\)
    Jun 24, 2006
  5. =?UTF-8?B?TWFydGluIFDDtnBwaW5n?=

    border-color: #003366; border-width: 2px;

    =?UTF-8?B?TWFydGluIFDDtnBwaW5n?=, Jul 17, 2006, in forum: HTML
    Replies:
    64
    Views:
    3,530
    Adrienne Boswell
    Jul 30, 2006
Loading...

Share This Page