JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div class="container"><div class="content"> This is the content div. It should be 10% from the left of the container </div></div>
</body>
CSS
html, body
{
width:100%;
height:100%;
}
.container { position: relative; width:50%; height:50%; border:1px solid red; } .content { position: absolute; left: 10%; top: 50%; }