JSFiddle - React, Tailwind, and code Playground
HTML
<div class="parent">
<div class="scrollContainer" id="trbx">
<div class="innerScroll">
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text goes here. Lots of text goes here.
Lots of text goes here. Lots of text...
CSS
.parent
{
margin:0px;
padding:0px;
height: 400px;
background-color: #808080;
border: none;
}
#trbx
{
width:100%;
height:100%;
margin:0px;
}
.scrollContainer
{
margin: 0px;
position: relative;
border: none;
bottom:0px;
top:0px;
left:0px;
right: 0px;
height:100%;
}
.innerScroll
{
overflow-y: auto;
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
}