【发布时间】:2020-05-04 11:14:33
【问题描述】:
我创建了一个带有标签的滑块。每个选项卡必须包含相应的背景图像。但在我的情况下,图像必须在元素的背景中。 单击选项卡时,图像必须更改 可以这样做吗?
<header class="header">
<div class="first_slider">
<div class="tabsy">
<input type="radio" id="tab1" name="tab" checked>
<label class="tabButton" for="tab1"><span class="btn_content">école</span></label>
<div class="tab">
<div class="content">
<img src="./app/img/slider_2.jpg" alt="">
<h3>Un printemps robotique à Arts et Métiers</h3>
<p>Le campus Arts et Métiers de Lille, se positionne comme un acteur incontournable de la robotique par ses activités de formation, de recherche et de transfert technologique. </p>
<a href=""> <i class="fas fa-angle-right"></i> Lire plus</a>
</div>
</div>
<input type="radio" id="tab2" name="tab">
<label class="tabButton" for="tab2"><span class="btn_content">Robotique</span> </label>
<div class="tab">
<div class="content">
<h3>Heading 2</h3>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</p>
<a href=""><i class="fas fa-angle-right"></i> Lire plus</a>
</div>
</div>
<input type="radio" id="tab3" name="tab">
<label class="tabButton" for="tab3"><span class="btn_content">industrie du futur</span> </label>
<div class="tab">
<div class="content">
<h3>Heading 3</h3>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</p>
<a href=""><i class="fas fa-angle-right"></i> Lire plus</a>
</div>
</div>
</div>
</div>
<div class="second_slider">
</div>
</header>
【问题讨论】:
-
您能否更详细地描述您的目标结果? “背景图片”到底是什么意思?例如,您可以通过 CSS 设置元素背景
-
我明白,但我希望我的图像适合我的标题标签而不是我的标签容器!我已经更新了我的图片示例