It works fine and is centred when the text is smaller, but for longer lines the text is outputted below the division
Below is the code. Its a div with 2 div side by side, where in the left div has an imp. I want text to be centred in the right div.
<div style={{ height: '12rem',textAlign: 'center', lineHeight: '12rem', backgroundColor: '#edf2f4'}} className="shadow rounded">
<div style={{width: '30%', float: "left", height: '10rem'}}>
<img src="https://images.unsplash.com/photo-1657299170964-205905bb0940?ixlib=rb-1.2.1&ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=870&q=80" style={{ width: '100%', height: '10rem', objectFit: 'contain'}} />
</div>
<div style={{ float: "left", paddingLeft: '2rem', overflow: 'auto'}}>
<p>vhvhvhvvhvhv vhvhv vhvhvh hvhvhv vhvhv hvhvh hhbh hbhb hbhb bhbh hbhb bhbh bhbh bh bhvhv</p>
</div>
</div>