我可以多次使用< h1>标记一个用于桌面另一个用于移动 [英] Can I use multiple times <h1> tag one for desktop another for mobile?

查看:98
本文介绍了我可以多次使用< h1>标记一个用于桌面另一个用于移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用bootstrap-3,html-5。我的问题是,我可以在同一页面中多次使用< h1> 标记吗?我正在为桌面使用一个< h1> ,为移动设备使用另一个< h1> 。在搜索问题后我有点困惑。任何人都可以正确地告诉我正确的方法吗?

I am using bootstrap-3 ,html-5. My question is, can I use <h1> tag multiple times in the same page? I am using one <h1> for desktop and another <h1> for mobile. I am bit confused after searching the question. Can any one correctly suggest me the right way?

我的代码如下。代码SEO是否友好?

My codes are below. Are the codes SEO friendly?

<div class="row">
  <div class="col-sm-12 hidden-xs">
      <h1>Header in Desktop</h1>
  </div>
  <div class="col-xs-12 hidden-lg hidden-md hidden-sm">
      <h1>Header in Mobile</h1>
  </div>
</div>


推荐答案

是的,你可以使用多个 h1 单个页面中的标签和SEO,google也确认使用多个 h1 标签都可以。只要每个 h1 标记位于 html5 的元素内(第一个 h1 在页面上不需要特定的包装器。)

Yes ofcourse, You can use multiple h1 tags in a single page and for SEO, google has also confirmed the use of multiple h1 tags are fine. It is valid as long as each h1 tag is inside a element of html5 (except for the first h1 on the page which does not need a specific wrapper).

目前,Google正在给出两个不同的等级,一个是桌面排名,另一个是移动排名。所以有两个 h1 标签很好(一个用于桌面,一个用于移动)。

Currently, Google is giving two different ranks, one rank for desktop and one rank for mobile. So having two h1 tags are fine (one for desktop, one for mobile).

你可以使用你的代码像这样。

You can use your code like this.

<div class="row">
  <div class="col-sm-12 hidden-xs">
      <h1>Header in Desktop</h1>
  </div>
  <div class="col-xs-12 visible-xs-*">
      <h1>Header in Mobile</h1>
  </div>
</div>

hidden-xs 表示它可见在桌面,平板电脑和隐藏在手机上。

hidden-xs means it will be visible on desktop, tablets and hidden on mobile.

visible-xs - * 表示它将在手机上显示隐藏在平板电脑,台式机等所有其他设备上。

visible-xs-* means it will be visible on mobile and hidden on all other devices like tablets, desktops.

这篇关于我可以多次使用&lt; h1&gt;标记一个用于桌面另一个用于移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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