Heading as Hyperlink

Is it legitimate to make a hyperlink a heading also?

Yes, you can even make a heading a hyperlink.

1 Like

Which order do I wrap things in?

<h3><a href=''></a></h3>

Or do I use…

<a href=''><h3></h3></a>

The former is probably best and should be suitable for most, if not all situations.

Thanks

To expand slightly on Ryan’s answer, headings - h1-h6 - are block-level elements, while <a> is an inline element. In versions of HTML prior to HTML5 it was not valid to nest a block-level element inside an inline element, and doing so would cause rendering problems in older browsers.

1 Like

Don’t quote me, but I believe it’s still invalid. It’s just that an exception was made for the anchor element since it’s so common.

The way you did the top left logo is fine, but you shouldn’t have made that covered in the <h1> tag. H1s are for headers. Your logo is not a header. Think of a blog article as a header. I’d remove that H1 and wrap it in a DIV instead.

Edit-OP deleted post but this is still relevant.

Edit2-Actually I don’t think it was OP…? Dunno…Was this a spam post? Mods? The link he gave might be a spam page to get business?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.