1

Description

I will give below some links examples in HTML code:

<a href="./add.php?page=1" target="_blank"><div class="menu-button" id="menu-btn-3">Add</div></a>
<a href="/index.php?page=2"><button type="button" class="button" style="background-color: rgb(32, 32, 32);">Next</button></a>

<a href="./profile-added.php?page=1" target="_blank">Add</a>

Two first links contains as anchor text div and button tags, which consecutive have also anchor text, but in plain form.

Third of examples is just normal link with plain anchor text.

Problem to solve

Using example with nonplain anchor text would affect my SEO rankings? Should I use third option instead to eventually improve my rankings?

Plus: If I ve this type of link:

<a><img /><a>

Is it more crawler friendly to give anchor text to link tag or only leave alt tag with description of image?

1
  • Looking deeper into questions here I find out that stack also preffer to ve plain text as anchor (for example questions titles). It's just a tip, maybe someone will see it as helpful to making his/her answer.
    – Xarvalus
    Commented Nov 17, 2013 at 18:11

1 Answer 1

1

Only very bad search engines (if any at all) would have a problem with child elements of a, as it’s very common and useful. Essentially it’s not different to other elements having child elements.

However, you should only use valid child elements:

  • button (or any other "interactive content" element) is not allowed
  • div (or any other block-level element) is only allowed in (X)HTML5 (but probably many older search engines can handle this, too, as it was not an uncommon error in HTML 4.01 times)

But elements like span, b, i, em, strong, code, img, abbr, etc. (and block elements in (X)HTML5) should be fine.

If links containing an img should have anchor text or not depends on the actual content: in some cases you want/need additional text, in other cases you don’t. However, you should never duplicate the information given in the alt attribute.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.