SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Guru
    Join Date
    Jan 2010
    Posts
    635
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    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

  2. #2
    SitePoint Mentor silver trophybronze trophy
    Mikl's Avatar
    Join Date
    Dec 2011
    Location
    Edinburgh, Scotland
    Posts
    1,554
    Mentioned
    63 Post(s)
    Tagged
    0 Thread(s)
    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

  3. #3
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,888
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Chris77 View Post
    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.
    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...

  4. #4
    SitePoint Guru
    Join Date
    Jan 2010
    Posts
    635
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    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

  5. #5
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,171
    Mentioned
    264 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by Chris77 View Post
    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>?
    <strong> implies emphasis, which isn't appropriate here. Just add a class and you can style these any way you like e.g.
    Code:
    <a href="address" class="next">Next Page: Title of next page</a>
    Code CSS:
    .next {font-size: 1.5em;
    color: #CC00CC;
    font-weight: bold;
    }

    Add bling to your heart's content.

  6. #6
    SitePoint Guru
    Join Date
    Jan 2010
    Posts
    635
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I keep forgetting to think like that, 'See if that tag will take a class.'

    Thanks TechnoBear,

    Chris

  7. #7
    SitePoint Member
    Join Date
    Dec 2011
    Location
    Santa Ana, CA, USA
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •