JSFiddle - React, Tailwind, and code Playground
HTML
<p>Click the spans "<span>this span</span>" to display its offset</p>
<div>This is NOT going to do something to the first line of whatever is in this div. But I'm going to try to find the position of <span>this span</span> and see if it works in IE9.</div>
<div class="first-line">This is going to do something to the first line of whatever is in this div. But I'm going to try to find the position of <span>this span</span> and see if it works in IE9.</div>
<div>This is NOT going to do something to the first line of whatever is in this div. But I'm going to try to find the position of <span>this span</span> and see if it works in IE9.</div>
CSS
div{
width:400px;
margin: 40px;
}
.first-line:first-line{
background-color: red;
color:#fff;
}
span{font-weight:bold}
JavaScript
$("span").click(function(){
$("#texto").append("Left: " + $(this).offset().left + " | Top:" + $(this).offset().top);
});