我想知道有没有人知道使用bootstraps可见类创建响应式网站的SEO影响?我使用这些类创建了一个带有Bootstrap的新网站.在大多数页面上,主要内容在左侧,然后页面右侧有多个链接.我的结构是这样的:
- <div class="row">
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
- //Main content here on left of page
- </div>
- <div class="col-lg-6 col-md-6 visible-lg visible-md">
- //Content on right of page for large and medium devices
- </div>
- <!--SMALL STARTS HERE-->
- <div class="col-sm-12 visible-sm">
- //Same content but drops below main content of page for small devices
- </div>
- <!--EXTRA SMALL STARTS HERE-->
- <div class="col-xs-12 visible-xs">
- //Same content again but drops below main content and is rendered for phones
- </div>
- </div>
所以我的问题是,如果这是一个坏主意或不?我担心Google / Bing / Yahoo会在网页上看到重复的内容,并对我造成惩罚.这是我应该担心的问题吗?谢谢.
解决方法
您不需要具有相似内容的单独div.下面的代码等同于您写的内容,内容与代码中的注释中所写的相同,即相同的内容
- <div class="row">
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
- //Main content here on left of page
- </div>
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
- //Content on right of page for large and medium devices
- </div>
- </div>
对于左拉和左拉,您可以通过添加左拉和右拉类来实现
- <div class="row">
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pull-left">
- //Main content here on left of page
- </div>
- <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pull-right">
- //Content on right of page for large and medium devices
- </div>
- </div>
如果您希望右侧的内容不会丢失,那么您必须专门指示不要像此一样放弃
- <div class="row">
- <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pull-left">
- //Main content here on left of page
- </div>
- <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 pull-right">
- //Content on right of page for large and medium devices
- </div>
- </div>
我不会建议您复制您的div内容,因为您已经意识到这不是您的SEO并不是维护友好(更新所有div的每一个变化,而不是一个div)