Minds gone blank HTML code for inserting link within an image!

Permabanned
Joined
17 Jan 2006
Posts
1,971
Location
Haskins
Its
Code:
a href=""
isnt it, but I cant remember where this comes within the [ i m g ] tag?

Thanks

EDIT: Found it, thanks
 
Last edited:
I think he means just plain HTML, which would be...

<a href="location of the link"><img src="location of the image" /></a>
 
Like Mr_L says ^^

I'd also add the alt="Alternate text" for validation ;) and border="0" so that there's no annoying border if you hover over it (in my opinion)

Hendrix
 
He could also add the "title" attribute. I'd put the border style in the CSS but that all depends on what is being used.
 
Mr_L said:
I think he means just plain HTML, which would be...

<a href="location of the link"><img src="location of the image" /></a>

XHTML uses /> to close image tags, not plain HTML.

If you are using normal HTML e.g. 4.01, then it is closed without the space and /.

So it would be

..of the image"></a>


/flees
 
Last edited:
Dj_Jestar said:
My word.. arguing over which standard of HTML he means.. are you bored?
Trust me when you're editing video and you keep going over the same boring bits, you get bored.
 
ok Ok, I use the word HTML 'loosly', I mean XHTML tbh!

Right, heres another one. I know that border="0" removes a hover, but how can i stop the link from changing colour. When I click it, and then return to the image it has a purple border around it!!
 
I know that border="0" removes a hover

No it doesn't, it stops there being a border around the image if it is hyperlinked. As the default border is 0 until you hyperlink the image.

You can have a border in HTML around any image without linking the image to anything.

Place border="0" in your <IMG> tag and you will not have a border at any time on that image, hyperlinked or not.
E.g:
Code:
<img border="0" src="source.jpg" alt="Banana dog" />
 
I did mention it subtley but like I said before it depends on the version of HTML you use. You can use the "border" attribute in a XHTML Transitional DT but you can't use it in a Strict DT.
 
Back
Top Bottom