Web Hosting Talk







View Full Version : Is there a right way to do this?


seodevhead
04-14-2006, 05:11 PM
Want to make a link out of my <h2> header.

So do I:

<a href="#"><h2>MY HEADER</h2></a>

or

<h2><a href="#">MY HEADER</a></h2>

Noticed some things were different in IE depending on which I used.

Thanks.

Amdac
04-14-2006, 05:33 PM
Both should work, but the second is better format. You generally want nothing within a link tag other than the link itself.

the_pm
04-14-2006, 05:38 PM
Always place the inline element inside of the block-level element.

<h2> = block-level element
<a> = inline element

therefore:

<h2><a></a></h2>

is correct :)

seodevhead
04-14-2006, 05:56 PM
5 out of 5 people agree, Amdac and the_pm are cool guys!

Amdac
04-14-2006, 05:57 PM
5 out of 5 people agree, Amdac and the_pm are cool guys!

I've waited many years for this day! :D

Bilco105
04-14-2006, 06:01 PM
I've waited many years for this day! :D
*feels left out* :(

the_pm
04-14-2006, 06:02 PM
5 out of 5 people agree, Amdac and the_pm are cool guys!Wow, how about that!

Now, to work my way up to being "kewl" :emlaugh: