< div>在< a>中,seo优化 [英] <div> within <a>, seo optimization

查看:186
本文介绍了< div>在< a>中,seo优化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文章列表(ul)。我想要每个ul列表元素可点击(100%宽度)作为锚点。

I have a list of articles (ul). I want each "ul" list element clickable (100 % width) as an anchor.

什么是更好的方法(根据SEO和Google机器人) / strong>

What is better approach (according to SEO and Google bots)?

1)HTML5允许将< div> a> ,所以我的代码是有效的(我已经在html5验证器中检查过)。也就是apple.com网站有相同的方法(h1-块元素 - 锚点内部)。

1) HTML5 allows to put <div> inside <a>, so my code is valid (I have checked it in html5 validators). Also i.e. apple.com website have the same approach (h1- block element - inside of anchor).

<ul>
  <li><a href="#"><div>Category</div><div>Title</div><div>Popularity</div></a></li>
  ...
</ul>

2)我也可以将li位置设置为relative,然后只有title但是这个锚点将具有position:absolute;和适当的填充以填充整个100%的高度和100%的宽度。在这种情况下,整个li元素是可点击的,但是这些方法似乎是不起眼的(在css),但它也适用于html 4.01和xHTML

2) I can also set li position as relative, and then have only "title" as link, but this anchor will have "position: absolute;" and proper padding to fill the whole 100% height and 100% width of li. In that case, whole li element is clickable, but these approach seems to be inelegant (in css), but also it's valid with html 4.01 and xHTML

<ul>
  <li><div>Category</div><a href="#">Title</a><div>Popularity</div></a></li>
  ...
</ul>


推荐答案

链接本身是否会被提取或使用锚文本?

What is your concern? Whether the link itself will be picked up or the anchor text used?

Google肯定会收到链接本身,因此没有问题。

Google will definitely pick up the link itself so there are no issues there.

然而,它可能会弄糊涂你正在链接的锚文本(和随后的链接的意图/语义)。您可以通过在锚点上使用 title 标记来帮助它。

It may however get confused over what anchor text you are linking with (and subsequently the intent/semantics of the link). You could probably help it by using a title tag on the anchor.

我期望它会看到锚文本作为类别标题人气。这本身是一个无意义的,所以我假设这不是一个问题给你,但我会,因为你关心的SEO,添加一个相关的标题到你的链接。

I expect it would see the anchor text as "Category Title Popularity". This by itself is a nonsensical so I am assuming this is not an issue to you but I would, as you are concerned with SEO, add a relevant title to your link.

这篇关于&lt; div&gt;在&lt; a&gt;中,seo优化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆