Validating <.h2> or images as a link in xhtml with out errors?

mal. D

New member
<div id="left-logo"><a href="index.xhtml"><h1>Logo</h1></a></div>

for some reason this is wrong since it is with in </a> that's fairly straight forward to understand
-----------------------------------------------------------------------------------------------------------------------
<div id="top-header"><a href="index.xhtml"></a><h1>header</h1></div>
this how ever is correct as it's out side the </a>
----------------------------------------------------------------------------------------------------------------------

but what are ways i can make the header and logo links with out getting errors,
i was reading block elements display:block but cant see how that would help

what i need is to find a way to get it validated even tho the top one is wrong it's easier to work with.

I ask my self why should i worry since all websites ive checked have over 80 errors so what's one little error.
i went in to clean up with the validator and it corrected with this

<div id="left-logo"><h1><a href="index.xhtml">Logo</a>
</h1>
</div>

why is that. it says this is correct, while now in stuck with a underline with in my logo. i can correct this just shocked it assumes this is correct
 
Back
Top