Using an Image as a Link

liunx

Guest
I want to get rid of the nasty border around my image that is put there when I use it as a link.<br />
<br />
I defined the link using this format:<br />
<br />
<A HREF=http://www.htmlforums.com/archive/index.php/"blah.html"><IMG SRC="blah.gif"></A><br />
<br />
<br />
Can I remove the border inline, or do I have to resort to CSS?<br />
<br />
Cheers,<!--content-->Use this attribute in your SCR tag.<br />
<br />
<A HREF=http://www.htmlforums.com/archive/index.php/"blah.html"><IMG SRC="blah.gif" border="0"></A><br />
<br />
<hint><br />
Dont capitalise any of your tags or attributes. w3 4.01 recomends against this, especially if you are going to use CSS at some point. I don't know why, but it is all about cross platform standards, and seeing that CSS is about cross platform standards it would be good to get into the habit.<br />
</hint><!--content-->The border is not part of the IMG element itself. It is part of the A (anchor) element.<br />
<br />
As for the capitals in the attributes, I think it is because of the new XML standards, rather than because of CSS (I am willing to be corrected on this point).<!--content-->The border attribute is a tied into the IMG tag and not the A (anchor) tag. I did a search in a couple of HTML 4.0 bibles just to double check. It may work in the anchor tag. But this is not how to do it.<br />
<br />
Double check a reliabe source. :D <br />
<br />
So my point is this...<br />
<br />
Could this be your problem?<br />
<br />
D'oh!<!--content-->Sorry Entimps. <br />
<br />
I checked against my reference and found that I was indeed wrong. The border is part of the image. I guess I missed a step when I tested it after your first suggestion.<br />
<br />
No hard feelings? :D<!--content-->Glad you got it sorted and no worries about the links.<br />
<br />
Do remember tho, if you can't post a link, a snippet of the source is sometimes more than enough to help.<!--content-->
 
Back
Top