32
loading...
This website collects cookies to deliver better user experience
</body>
tag ends. Reason for placing it at the bottom like we are doing now is we don't slow down the initial render of HTML.<script src="https://cdn.jsdelivr.net/npm/@splidejs/[email protected]/dist/js/splide.min.js"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@splidejs/[email protected]/dist/css/splide.min.css"
/>
<div class="splide">
<div class="splide__track">
<ul class="splide__list">
<li class="splide__slide"></li>
<li class="splide__slide"></li>
<li class="splide__slide"></li>
</ul>
</div>
</div>
<li class="splide__slide"></li>
tags.<div class="splide__slide__container">
<div class="slide__content">"I'm flabbergasted after using this product. No Regrets. Ever."
</div>
</div>
splide__slide__container
is where we do all the adjustments such are setting the max-width
for the content.splide__slide__container
is also pretty useful if you are having an image and you want to set a specific height for your image and go full blown cover mode but more on that later.border-radius: 1px solid red
around the element to easily identify where you are actually applying your styles.<style>
*{
box-sizing: border-box;
font-family: 'Inter', sans-serif;
}
body{
margin: 4rem 0;
}
.splide__slide{
padding: 6rem;
display: flex;
justify-content: center;
background: #ECF0F1 ;
}
.splide__slide__container{
width: 600px;
text-align: center;
}
.slide__content{
margin: 1rem 0;
font-size: 1.3rem;
}
.slide-img__wrapper{
display: flex;
align-items: center;
}
.slide-img{
width: 60px;
height: 60px;
border-radius: 50%;
max-width: 100%;
max-height: 100%;
}
.slide-img__caption{
margin-left: 1rem;
}
.slide-img__caption span{
color: #2E86C1 ;
font-weight: 500;
}
</style>
<script>
document.addEventListener( 'DOMContentLoaded', function () {
new Splide( '.splide' ).mount();
} );
</script>
splide__arrows
and splide__pagination
. What do these mean ?
.splide__pagination__page.is-active {
transform: scale(1.5); //here I have changed the scale from 1.4 to 1.5
background: #0b72e7; //changed from default bg-color to blue
}