Forum Moderators: open

Message Too Old, No Replies

valid xhtml image link?

xhtml 1.1

         

seanghatch

5:56 am on May 20, 2007 (gmt 0)

10+ Year Member



How do I make a valid xhtml image link? You know, where a picture links to another page.

In general, I'm trying something like this:

<a href = "..."><img src = "..."></a>

and the validator says: document type does not allow element "a" here; missing one of "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "pre", "address", "fieldset" start-tag.

Here is my doctype declaration:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Thanks!

birdbrain

6:23 am on May 20, 2007 (gmt 0)



Hi there seanghatch,

It needs to be like this...


<div>
<a href="#>
<img src="myimage.jpg" alt="image description" />
</a>
</div>


birdbrain