PDA

View Full Version : Question:Making an image a link, removing the link boar...


J A S O N
01-13-2000, 02:50 AM
i want to make an image a link on my site, but i keep getting a boarder around it.

Does anyone know how i can get rid of this?

Thanks in advance!

Deb
01-13-2000, 02:54 AM
Visit http://www.aota.net/HTML/images.php3 for help on this one -- scroll down to the last section.[nbsp][nbsp]It explains the border tag which will solve the problem :)

Deb
[nbsp]- To frame or not to frame

Shalazar
01-13-2000, 01:45 PM
Having no border is real easy, it just adds an extra variable to the <img> tag.

Here's what I use as my full <img> link:

<img src=&quot;URL&quot; height=&quot;H&quot; width=&quot;W&quot; hspace=&quot;X&quot; vspace=&quot;Y&quot; ALT=&quot;alt text here&quot; border=&quot;Z&quot;>


All of those are self-explanatory.[nbsp][nbsp]Note the border variable at the end.[nbsp][nbsp]Putting a border=&quot;0&quot; in there will prevent any borders from being placed around your image, which is important when you're linking it.

------------------
Shalazar

www.charisma-carpenter.com (http://www.charisma-carpenter.com)
The Internet's Premier site for everything Charisma.

Dan Kaplan
01-13-2000, 02:11 PM
hspace=&quot;X&quot; vspace=&quot;Y&quot; Could someone please explain to me what this actually does?[nbsp][nbsp]I know its purpose in theory, but I've yet to see a documented example of it actually serving any function...[nbsp][nbsp]I've tried using it in several places -- and I've read where it's supposedly useful -- yet it seems to work identical with or without.

Justin, what do you think about needless extra code?[nbsp][nbsp];)

Dan

Justin
01-13-2000, 02:40 PM
HSPACE == Horizontal Space
VSPACE == Vertical Space

Both add a padding space around the image. Some older browsers I believe do add a default amount of space, though most I've used default to zero.

Where this is handy is when using a single pixel transparent GIF for formatting. Let's say you need a column that is about 15 pixels wide. Three ways to do this are:
</font><font face="Courier" size="3">
1) <td><img src=&quot;1x1.gif&quot; height=1 width=15 border=0></td>
2) <td width=15><img src=&quot;1x1.gif&quot; height=1 width=1 border=0></td>
3) <td><img src=&quot;1x1.gif&quot; height=1 width=1 border=0 hspace=7 vspace=0></td>
</font><font face="Verdana, Arial" size="2">
The first sets the width of the image to 15. Stretching an image in HTML is usually a bad thing, even on a single pixel transparent gif, because some browsers don't size them well and it may lose it's transparent property...

The second does not always work in all browsers unless you specify a pixel size for all <TD> tags - so using percentages for the rest of the table would not work.

The third simple forces 7 pixels on each side of the image, plus it's 1 pixel width, resulting in a 15 pixel spacing :)

I always put in a little extra code if it helps the site work in all browsers - One of my goals with any site is to make it look the same in all browsers (or as absolutely close as is humanly possible :P)

------------------
Justin Nelson
FutureQuest Support

Dan Kaplan
01-13-2000, 08:17 PM
Hi Justin,

Thanks for the detailed explanation.[nbsp][nbsp]I should have stated the question differently:[nbsp][nbsp]I understand its purpose with non-zero values, it's the hspace=&quot;0&quot; and vspace=&quot;0&quot; that I've yet to see make any difference...[nbsp][nbsp]Although, as you say, it might just be in older browsers.[nbsp][nbsp]I suppose it's in the same class as web safe color pallettes -- couldn't hurt to plan around, but good luck ever finding a real need.[nbsp][nbsp]:)

I hadn't heard the theory that it's bad to stretch transparent images.[nbsp][nbsp]I know Netscape 3 and Opera are not crazy about the technique, but they seem to just ignore the stretched image, leaving no transparency problems.[nbsp][nbsp]Which browsers have you seen other problems with?

Anyone know of places to find old, old browsers?[nbsp][nbsp]I only have Netscape 3 because the school gave it out on disk with their custom splash page, and I never bothered deleting it.

Dtest != Dlete