Help with Border

K

Keith Smith

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>
 
A

Adrienne

Gazing into my crystal ball I observed "Keith Smith"
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.
 
G

Gareth J M Saunders

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top