JSFiddle - React, Tailwind, and code Playground
HTML
<div
class="widget"
style="width: 300px; height: 500px; border: 1px solid blue"
>
<div class="main-wrapper">
<div class="animationDiv">
<a href="https://google.com" class="slot">
<div class="left">
<img
src="https://via.placeholder.com/150"
alt=""
/>
</div>
<div class="right">
<div class="title">1 Some title text</div>
<div class="text">
Content text, content text, content text, content text, content
text
</div>
</div>
</a>
<a href="https://google.com" class="slot">
<div class="left">
<img
src="https://via.placeholder.com/150"
alt=""
/>
</div>
<div class="right">
<div class="title">2 Some title text</div>
<div class="text">
Content text, content text, content text, content text, content
text
</div>
</div>
</a>
<a href="https://google.com" class="slot">
<div class="left">
<img
src="https://via.placeholder.com/150"
alt=""
/>
</div>
<div class="right">
<div class="title">3 Some title text</div>
<div class="text">
Content text, content text, content text, content text, content
text
</div>
</div>
</a>
</div>
</div>
</div>
CSS
.main-wrapper {
height: calc(100% - 20px);
width: calc(100% - 20px);
display: flex;
flex-direction: column;
align-items: flex-start;
padding: 10px;
justify-content: flex-start;
border: 1px solid lightgrey;
}
.main-wrapper a {
text-decoration: none;
color: black;
font-family: Arial, Helvetica, sans-serif;
border-bottom: 1px dotted lightgrey;
padding: 10px 0;
overflow: hidden;
position: relative;
box-sizing: border-box;
display: block;
height: 190px;
animation: slider 15s linear infinite;
}
.main-wrapper a .right .title {
font-weight: 600;
}
.main-wrapper img {
height: 100px;
padding: 5px;
border: 1px solid lightgrey;
}
.main-wrapper .animationDiv {
overflow: hidden;
background: #ffffff;
position: relative;
}
@keyframes slider {
0% {
top: 0;
}
100% {
top: -570px;
}
}