Hey,
This code gives a validation error when checked with w3c’s validator.
<div>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Strict" height="31" width="88" />
</a>
</div>
I know it’s a block element contained in an inline-element but how else can I fix this ?
There’s nothing wrong with as a fragment - <img> is an inline element, so it can go inside <a>.
It won’t validate if you just put it into the validator like that, because it wants a whole page - but if you include it within an XHTML page, you shouldn’t get any validation errors from it. If you do, post a link to your page and we’ll see what else is causing it.
Ok here is the page: www.haasfazant.co.cc - Click on the w3c validation icon and you will see it doesn’t validate.
Friendly greetings,
Ajajajak
You did not post the actual code present on your page.
It’s:
<div id="footer">
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Strict" height="31" width="88" />
<a href="http://jigsaw.w3.org/css-validator/check/referer">
<img style="border:0;width:88px;height:31px"
src="http://jigsaw.w3.org/css-validator/images/vcss"
alt="Valid CSS!" />
</a>
</a>
</div>
And it seems obvious to me what the error is. Do you see it?
Ah i must have uploaded an older version to the server because it doesn’t show an extra </a> tag in my notepad…hehe. I think that should fix it
Thanks for pointing it out
It’s not exactly an ‘extra’ </a>, it’s an </a> at the wrong spot, creating an <a> inside an <a>
You are right. I went too quick