...

View Full Version : problwm with tag's a



hno2005
12-04-2009, 12:51 PM
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

Rowsdower!
12-04-2009, 01:13 PM
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

The anchor (<a> tag) is an inline tag. Heading tags (<h1>, <h2>, ..., <h6>) are all block-level tags. It is invalid code to place a block-level tag within an inline tag. To resolve the issue you will need to either change from a heading tag to a span tag for that text (and style it to make it resemble the heading) or else break up that link so that one instance only contains the image and the other instance is inside of the heading tag.

So, either this:

<a href=... >
<img src=... /><br />
<span>Some Text</span>
</a>

or this:

<a href=... ><img src=... /></a>
<h1><a href=... >Some Text</a></h1>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum