Anchor inside heading or not? - markup relation question

Hello all, again,

I have something like this on the markup:
Aside must be the question about if we should or should not use an img inside h1 element.

I have the following:


<h1><a href="#"><img id="logo" alt="This is a very informative logo" src="Imagens/logo.png"/></a>
</h1>

But the link area grabbed by the browser is not having into consideration the A element area, but the <h1> one. :s

Why? What is/could be the cause for this?

Thanks in advance,
Márcio

That is because you don’t have any text within the <h1> and the image is nested within the <h1> element. Also the anchor you have has no ID value so won’t specifically get targeted.

But isn’t a inline? Is A element taking all the container dimensions?
I’ve added a ‘.’ within h1 just to see if a gets wrapped, but no luck. Still takes all h1 space. :s

What does it mean, not get targeted on this context?

As a solution for this, should we go CSS ?

Thanks
Márcio