0

HI
i have used tag's a to link a address. i've used it like this :

<a ... > <img ... /><br /> <h1> example </h1></a>

when i've validate it , this error has been showed .

is there any problwm if i've used tag's a like this .

thanks

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by ko ko
0

The anchor element is an inline element. Inline element can't contain block level element. You put h1 tag in anchor tag. It makes the browser confuse. You should write like that:

<h1>Example<a href="#"><img src="image.gif" /></a></h1>
<h1><a href="#"><img src="image.gif" /></a>Example</h1>
<h1><a href="#"><img src="image.gif" /></a><br />Example</h1>

The block element can contain inline and other block level element.

<div><!-- The div is block element -->
        <h1>This is block element heading</h1>
</div>
<!-- This is available -->

<span><!-- The span is inline element -->
         <h1>This is block element heading</h1>
</span>
<!-- This one is unavailable -->

I hope this will help you...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.