Container for Splide #678
-
Having some issues with the container for splide. I am looking to add multiple sliders on the same page, but the slider always pushes the container for splide out of the page bounds right side. Pretty new to this and nothing seems to be working to limit the slider width, other then limiting the number of slides in the slider. <style>
.splide__slide img {
width: auto;
height: 150px;
}
.contentSlider{
text-align: center;
width:100%;
overflow: hidden;
}
</style>
<div class="contentSlider">
<h1>Exclusive Items</h1>
<table>
<tr>
<td>
<div class="splide" id="exclusiveProducts">
<div class="splide__track">
<ul class="splide__list">
<li class="splide__slide">
<div class="splide__slide__container">
<img src="images/TOMATOESINBAG2021.jpg" alt="4x4 Plastic Bag 2 Mil" title=" 4x4 Plastic Bag 2 Mil " /></a>
</div><span style="color:black;">4x4 Plastic Bag 2<br />Mil</span>
</li>
</ul>
</div>
</div>
</td>
</tr>
</table>
</div>
<script>
document.addEventListener( 'DOMContentLoaded', function () {
new Splide( '#featuredProducts', {
perPage :'8',
gap : '0.1em',
padding: '1%',
width: '60%',
type : 'loop',
drag : true,
autoWidth : false,
pagination : false,
} ).mount();
} );
</script> Basically I am looking to add 1 to n sliders on a page, and limit the width to the full page width, on a browser. thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
I don't understand what's going on, but:
|
Beta Was this translation helpful? Give feedback.
-
The culprit is this table: <table width="100%" style="background:#ffffff;"> Do not use a table tag for layout purpose. It's not semantic and your code easily gets out of control. |
Beta Was this translation helpful? Give feedback.
The culprit is this table:
Do not use a table tag for layout purpose. It's not semantic and your code easily gets out of control.