隐藏< h1>的正确方法是什么?标记,并且不会被禁止使用Google吗? [英] What's the correct way to hide the <h1> tag and not be banned from Google?

查看:144
本文介绍了隐藏< h1>的正确方法是什么?标记,并且不会被禁止使用Google吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用的网站使用CSS中定义的图片作为主要标志。 html代码如下所示:

The website I am working on uses an image defined in CSS as the main logo. The html code looks like this:

<h1>Something.com | The best something ever</h1>

我想只显示CSS中定义的图像,并将h1标签中的信息传递给

I would like to display just the image defined in CSS and pass the information from the h1 tag to the search enginges only.

这是什么正确的方法? Google对此非常严格,我知道显示:没有错误,可见性如何隐藏?

What's the correct way to do this? Google is very strict about this, I know that display:none is wrong, what about visibility: hidden ?

提前感谢!

你应该可以用 visibility:hidden

也就是说,如果您的图片属于内容的一部分(我敢说公司徽标是内容, ,并且你关心可访问的html,你应该考虑修改你的代码,将图像作为 img 元素包含 title alt ernate文本,而不是css background-image

That said, if your image is part of the content (and I would dare to say that a company logo is content, not presentation), and you care about accessible html, you should consider changing your code to include the image as a img element with title and alternate text, instead of a css background-image.

此外,如果您希望将搜索引擎吸引到< h1> 元素中的关键字,您可能希望在网页中多次包含这些词。例如,页面标题比 h1 元素更相关。

Additionally, if you hope to attract search engines to the keywords inside the <h1> element, you might want to include those words more than once in the page. The page title is a much more relevant place than the h1 element, for example.

这篇关于隐藏&lt; h1&gt;的正确方法是什么?标记,并且不会被禁止使用Google吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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