【发布时间】:2017-12-21 17:32:09
【问题描述】:
看这张图片:
我正在使用改编的白兰度主题。我想在使用选择器时更改图像,但我只能更改文本,我知道为什么。我将在底部发布代码,但在代码上我用
定义了一个背景 divcol-md-6 col-sm-6 col-xs-12
和右边的项目选择器有这个
col-md-12 col-sm-12
显然,当我尝试在任何较小的 div 中重复较大的 div 时,它无法正常工作。在选择器上方,我有这个:
<!-- section image -->
<div class="col-md-6 col-sm-6 col-xs-12 no-padding architecture-title cover-background overflow-hidden " style="background-image:url('images/complexo.jpg');"> </div>
<!-- end section image -->
我试图创建一个 PHP/Javascript 变量,但我有点新,我仍然不知道如何正确地做到这一点。我正在考虑将背景图像放在 PHP 变量上或使用 javascript,但我真的不知道该怎么做。代码如下:
<!-- about section -->
<section id="complexo" class="wow fadeIn no-padding">
<div class="container-fluid">
<div class="row">
<!-- section image - HERE IS THE IMAGE THAT I WANT TO LINK WITH THE SELECTOR, AS YOU CAN SEE, THE DIV HAS A DIFFERENT COLUMN CONFIGURATION, SO I CAN'T PUT ONE INSIDE ANOTHER -->
<div class="col-md-6 col-sm-6 col-xs-12 no-padding architecture-title cover-background overflow-hidden " style="background-image:url('images/complexo.jpg');"> </div>
<!-- end section image -->
<!-- section title -->
<div class="col-md-6 col-sm-6 col-xs-12 no-padding architecture-title sm-min-height-auto">
<div class="architecture-section">
<span class="title-extra-large alt-font font-weight-600 text-uppercase deep-gray-text display-block sm-title-large"> CONHEÇA O COMPLEXO</span>
<br><br>
<!-- tab navigation - HERE IS THE SELECTOR -->
<ul class="nav nav-tabs alt-font text-uppercase letter-spacing-1 no-border font-weight-600" role="tablist">
<li role="presentation" class="active xs-display-block xs-margin-nine xs-no-margin-lr xs-no-margin-top"><a href="#creativity" aria-controls="creativity" role="tab" data-toggle="tab" class="xs-display-inline ">Viva</a></li>
<li role="presentation" class="xs-display-block xs-margin-nine xs-no-margin-lr xs-no-margin-top"><a href="#innovation" aria-controls="innovation" role="tab" data-toggle="tab" class="xs-display-inline ">Trabalhe</a></li>
<li role="presentation" class="xs-display-block xs-margin-nine xs-no-margin-lr xs-no-margin-top"><a href="#point-of-view" aria-controls="point-of-view" role="tab" data-toggle="tab" class="xs-display-inline ">Aproveite</a></li>
</ul>
<!-- end tab navigation -->
<div class="tab-content clearfix margin-twenty no-margin-lr no-margin-bottom sm-margin-nine sm-no-margin-lr sm-no-margin-bottom">
<!-- tab item -->
<div role="tabpanel" class="tab-pane fade in active" id="creativity">
<div class="col-md-12 col-sm-12 no-padding"> <!-- ANY TAB ITEM HAVE A SMALLER COLUMN CONFIGURATION, SO I CAN'T JUST PUT THE BIGGER DIV HERE-->
<p class="text-medium width-70 md-width-90 sm-width-100">Lorem Ipsum is simply dummy text of the printing & typesetting industry. Lorem Ipsum has been the industry's standard dummy. Lorem Ipsum is simply dummy text of the printing & typesetting industry. Lorem Ipsum has been the industry's standard dummy.</p><br>
<p class="text-medium width-70 md-width-90 sm-width-100">Lorem Ipsum is simply dummy text of the printing & typesetting industry. Lorem Ipsum has been the industry's standard dummy. Lorem Ipsum is simply dummy text of the printing & typesetting industry. Lorem Ipsum has been the industry's standard dummy.</p>
</div>
</div>
<!-- end tab item -->
<!-- tab item -->
<div role="tabpanel" class="tab-pane fade in" id="innovation">
<div class="col-md-12 col-sm-12 no-padding">
<p class="text-medium width-70 md-width-90 sm-width-100">Lorem Ipsum is simply dummy text of the printing & typesetting industry. Lorem Ipsum has been the industry's standard dummy. Lorem Ipsum is simply dummy text of the printing & typesetting industry.</p><br>
<p class="text-medium width-70 md-width-90 sm-width-100">Lorem Ipsum is simply dummy text of the printing & typesetting industry. Lorem Ipsum has been the industry's standard dummy. Lorem Ipsum is simply dummy text of the printing & typesetting industry. Lorem Ipsum has been the industry's standard dummy. Lorem Ipsum has been the industry's standard dummy.</p>
</div>
</div>
<!-- end tab item -->
<!-- tab item -->
<div role="tabpanel" class="tab-pane fade in" id="point-of-view">
<div class="col-md-12 col-sm-12 no-padding">
<p class="text-medium width-70 md-width-90 sm-width-100">Lorem Ipsum is simply dummy text of the printing & typesetting industry. Lorem Ipsum has been the industry's standard dummy. Lorem Ipsum is simply dummy text of the printing & typesetting industry. Lorem Ipsum has been the industry's standard dummy.</p><br>
<p class="text-medium width-70 md-width-90 sm-width-100">Lorem Ipsum is simply dummy text of the printing & typesetting industry. Lorem Ipsum has been the industry's standard dummy. Lorem Ipsum is simply dummy text of the printing & typesetting industry. Lorem Ipsum has been the industry's standard dummy.</p>
</div>
</div>
<!-- end tab item -->
</div>
</div>
<!-- end section title -->
</div>
</div>
</section>
<!-- end about section -->
所以,我通过 Javascript 解决了它,现在它可以正常工作了。
【问题讨论】:
-
我现在阅读它,我会告诉你问题是否相同。如果是,我真的很抱歉。
-
您的问题不是 1:1 匹配 - 而是您想要实现的目标可以通过简单地让 1
.nav-tabs影响两个单独的选项卡面板来完成。 -
实在不行,我现在用javascript试试。
标签: javascript php html twitter-bootstrap twitter-bootstrap-3