JSFiddle - React, Tailwind, and code Playground
HTML
<div class="cont">
<p>
<span class="before">cassscbbbbbbbbbbbsvvvvvccs ...</span>
Just some random text. This
is just some random text.
This is just some random
text. This is just random
is just some random
text. This is just random.</p>
</div>
CSS
.cont {
padding-left: 50px;
padding-top: 20px;
width: 300px;
height: 400px;
background-color: #eee;
}
p {
display: block;
position: relative;
background-color: #eee;
width: 80%;
float: right
}
.before {
position: absolute;
}
JavaScript
$(document).ready(function () {
var cont = $('.cont');
var contWidth = $('.cont').width();
var before = $('.before');
var beforeWidth = before.width();
var paragraph = cont.find('p');
cont.css({
paddingLeft: beforeWidth
});
before.css({
left: - beforeWidth - 5
});
});