JSFiddle - React, Tailwind, and code Playground
HTML
<p>This is a lot of text.This is a lot of text. <span>This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text. This is a lot of text.</span>This is some more text, but now after the span!</p>
<div></div>
CSS
span {
background: yellow;
}
JavaScript
$(window).on("resize",function(){
$('div').append('</br>'+$('span').outerHeight(true));
$('div').append('</br>'+$('span').offset().top);
$('div').append('</br>'+$('span').offset().left);
$('div').append('</br>'+$('span').position().top);
$('div').append('</br>'+$('span').position().left);
});