JSFiddle - React, Tailwind, and code Playground
by rami7250
HTML
<div class='slider'>
<div class='slide1'>
<div class="elements-promo">
<div class="elements-promo__copy-wrapper">
<div class="elements-promo__content">
<a class="fill" href="http://ebaysecrets.co.il/">
<h2 class="elements-heading fds-c-text-heading -size-l fds-u-mb0">עשרת הדברות: קניה נכונה באיביי</h2>
<p class="elements-heading fds-c-text-body fds-u-mb0">הדרך הנכונה לקנות נכון, לקנות חכם.</p>
<br><br>
</a>
<div class="elements-promo__button-wrapper">
<a class="elements-promo__button" href="http://ebaysecrets.co.il">קרא עוד</a>
</div>
</div>
</div>
</div>
</div>
<div class='slide2'>test2</div>
<div class='slide3'>test3</div>
</div>
CSS
.slider {
min-width:560px;
max-height: 250px;
margin: 20px auto;
position: relative;
}
.slide1, .slide2, .slide3 {
position: absolute;
width: 100%;
height: 100%;
opacity: 0;
background-size: cover;
animation: fade 30s linear infinite;
}
.slide1 {
animation-delay: 0s;
}
.slide2 {
animation-delay: 10s;
}
.slide3 {
animation-delay: 20s;
}
@keyframes fade {
/* assumes a total duration of 3(0)s */
6.6% { opacity: 1; } /* 2s */
26.6% { opacity:1; } /* 8s */
33.3% { opacity:0; } /* 10s */
}
/* elements */
.fill
{
display: block;
height: 100%;
width: 100%;
text-decoration: none;
}
h2
{
font-family: arial;
}
.elements-promo {
margin-bottom: 52px;
margin-top: 60px;
background-color: #f93d66;
background: linear-gradient(145deg, #4772d9, #5be0e0);
border-radius: 4px;
font-family: arial;
direction:rtl;
}
.elements-promo__wrapper {
padding: 20px;
background-color: #fff
}
@media (min-width:960px) {
.elements-promo__wrapper {
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: justify;
justify-content: space-between
}
}
@media (max-width:639px) {
.elements-promo__wrapper {
text-align: center
}
}
.elements-promo__copy-wrapper {
-ms-flex: 0 0 75%;
flex: 0 0 75%;
margin: 16px 0px;
background-position: 100% left bottom;
background-repeat: no-repeat;
}
@media (min-width:660px) {
.elements-promo__copy-wrapper {
background-image: url("//public-assets.envato-static.com/assets/cross-promos/girl-with-headphones-f811be66c897e4e8d9243e07b77c3745eef05c9ab0862c903d1a88e794ce74c6.png")
}
}
.elements-promo .elements-heading {
color: #fff
}
.elements-promo__button-wrapper {
padding-top: -15px;
margin-top: -15px;
@media (min-width: 960px) {
-ms-flex:0 0...