css – SEO引导的影响可见 – lg / md / sm / xs – 类

前端之家收集整理的这篇文章主要介绍了css – SEO引导的影响可见 – lg / md / sm / xs – 类前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想知道有没有人知道使用bootstraps可见类创建响应式网站的SEO影响?我使用这些类创建了一个带有Bootstrap的新网站.在大多数页面上,主要内容在左侧,然后页面右侧有多个链接.我的结构是这样的:
  1. <div class="row">
  2. <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
  3. //Main content here on left of page
  4. </div>
  5.  
  6. <div class="col-lg-6 col-md-6 visible-lg visible-md">
  7. //Content on right of page for large and medium devices
  8. </div>
  9.  
  10. <!--SMALL STARTS HERE-->
  11. <div class="col-sm-12 visible-sm">
  12. //Same content but drops below main content of page for small devices
  13. </div>
  14.  
  15. <!--EXTRA SMALL STARTS HERE-->
  16. <div class="col-xs-12 visible-xs">
  17. //Same content again but drops below main content and is rendered for phones
  18. </div>
  19. </div>

所以我的问题是,如果这是一个坏主意或不?我担心Google / Bing / Yahoo会在网页上看到重复的内容,并对我造成惩罚.这是我应该担心的问题吗?谢谢.

解决方法

您不需要具有相似内容的单独div.下面的代码等同于您写的内容,内容代码中的注释中所写的相同,即相同的内容
  1. <div class="row">
  2. <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
  3. //Main content here on left of page
  4. </div>
  5.  
  6. <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
  7. //Content on right of page for large and medium devices
  8. </div>
  9. </div>

对于左拉和左拉,您可以通过添加左拉和右拉类来实现

  1. <div class="row">
  2. <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pull-left">
  3. //Main content here on left of page
  4. </div>
  5.  
  6. <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pull-right">
  7. //Content on right of page for large and medium devices
  8. </div>
  9. </div>

如果您希望右侧的内容不会丢失,那么您必须专门指示不要像此一样放弃

  1. <div class="row">
  2. <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pull-left">
  3. //Main content here on left of page
  4. </div>
  5.  
  6. <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pull-right">
  7. //Content on right of page for large and medium devices
  8. </div>
  9. </div>

我不会建议您复制您的div内容,因为您已经意识到这不是您的SEO并不是维护友好(更新所有div的每一个变化,而不是一个div)

猜你在找的CSS相关文章