Linking With Headings

Sitepoint Members,

The way I have a link to the next page on the pages of my site is
<h2>Title Of Next Page</h2>
<a href=“next page address”>Next Page</a><br />

I’d really like to get the text linked, instead of the linked text being “Next page”.

Is this a better way, for search engines?

<a href=“next page address”><h2>Title Of Next Page - Next Page</h2></a><br />

It seems obvious but when I do it this way the <a href…> color takes of the h2 color.

Thanks,

Chris

In that case, why not simply remove the <h2> tag completely? Not only will that give you the style you want, but it is more semantically correct, given that a link to next page is not a heading.

Mike

[font=verdana]The problem there is that you’ve got your tags inside out.

You aren’t allowed to have an <h2> inside an <a>, it has to be the other way round. So put the <a>…</a> tags inside the <h2>…</h2> tags, and then you should get the colour you want. (And if it doesn’t work then there will be something that needs to be changed in the CSS, but it isn’t a big deal to do that!)

Don’t think about how search engines perceive the links – think about how people will see and understand them. If you’ve got a page title and all that relates to that is a link to the page, just make that text into the link. As long as it looks like a link, people will understand that it’s a link, and if it’s obvious where it goes to (because the link text is the page title) then people and search engines alike will be able to deal with it just fine.

As Mikl says, it doesn’t sound all that much like you’ve actually got a heading there, so you may want to rethink your use of the <h2> tags and consider replacing them with <p>, <div> or <ul>/<li>. Either way, you almost certainly shouldn’t be using a <br /> tag there, when margins and padding were invented over 10 years ago…[/font]

Actually what I had was the h2 and <a href…> the other way around, sorry, and the h2 color was lost, so I swithched them and got an error. So I chnaged the code and now I have
<a href=“address”>Next Page: Title of next page</a><br /><br />

It looks pretty sad. Any suggestions? Are there no bling methods in link text? Maybe <strong>?

Thanks,

Chris

[FONT=Verdana]<strong> implies emphasis, which isn’t appropriate here. Just add a class and you can style these any way you like e.g.

<a href="address" class="next">Next Page: Title of next page</a>

.next {font-size: 1.5em;
color: #CC00CC;
font-weight: bold;
}

Add bling to your heart’s content. :)[/FONT]

I keep forgetting to think like that, ‘See if that tag will take a class.’

Thanks TechnoBear,

Chris

H2 uses for sub heading.

Better not use it for next page link. Give link from a keyword to other page and bold the keyword.

Remember that make your site for traffic not for search engine.