我一直在尝试使用灵活的 slider ,但遇到了一个小问题。我有两个部分要使用 slider 。第一个只是一张图片的“淡入淡出”效果,第二个是推荐 slider 。现在的问题是,如果我想在我的推荐信之间留出余地,我会使用:
.slick-slide {
margin: 0px 10px;
}
See picture of margin between the testimonials
HTML 标记 -
<div class="slider">
<div class="testimonial-container">
<div class="testimonial-img">
<img src="images/face.jpg" alt="face">
</div>
<div class="testimonial-text">
<h3>This is the only Norskkurs to take in Stavanger if value for
money and truly progressing with
the Norwegian are important factors for you.
</h3>
<strong>Jessica Morris</strong>
<p>A1/A2 Student</p>
</div>
</div>
<div class="testimonial-container">
<div class="testimonial-img">
<img src="images/face.jpg" alt="face">
</div>
<div class="testimonial-text">
<h3>Very hands on and animated. Relaxed atmosphere which is
perfect for feeling comfortable in a new language setting.
</h3>
<strong>Helen Brian</strong>
<p>A2 Student</p>
</div>
</div>
<div class="testimonial-container">
<div class="testimonial-img">
<img src="images/face.jpg" alt="face">
</div>
<div class="testimonial-text">
<h3>This course is a wonderful journey with lots of fun and
activities towards the goal. It's a well
designed course for learning.
</h3>
<strong>Chidabaram Harikumar</strong>
<p>A1/A2/B1 Student</p>
</div>
</div>
<div class="testimonial-container">
<div class="testimonial-img">
<img src="images/face.jpg" alt="face">
</div>
<div class="testimonial-text">
<h3>It is first language course which I have lasted more than one month :) . It means alot to me. They
teach with both their heart and brain.
</h3>
<strong>Amir Ghaderian</strong>
<p>A2/B1 Student</p>
</div>
</div>
<div class="testimonial-container">
<div class="testimonial-img">
<img src="images/face.jpg" alt="face">
</div>
<div class="testimonial-text">
<h3>One of the best thing which I have done in my life is to join Norskkurs in LNS.It's a great place to
learn the language with good people.
</h3>
<strong>Dayanand Mohanasundram</strong>
<p>A1/A2 Student</p>
</div>
</div>
</div>
现在我的下一张“淡入淡出”幻灯片我不想要边距,但它仍然会向我使用的所有幻灯片添加相同的 .slick-slide 属性。
无论如何我只能将其应用于一张幻灯片或从其他幻灯片中删除此类/属性吗?
简而言之,我只需要推荐幻灯片与另一张幻灯片之间的空白。我该如何解决这个问题?
最佳答案
您可以将类(class)推荐添加到推荐 slider ,并为该类(class)添加边距。
.testimonial-slide {
margin: 0px 10px;
}
关于javascript - 如何从 Slick Slider 中删除类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58608609/