<div
style={{
width: 200,
height: 200,
backgroundColor: 'gray',
position: 'relative',
}}
>
<div
style={{
width: 100,
height: 100,
backgroundColor: 'black',
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%,-50%)',
}}
></div>
</div>
<div
style={{
width: 200,
height: 200,
backgroundColor: 'gray',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}
>
<div
style={{
width: 100,
height: 100,
backgroundColor: 'black',
}}
></div>
</div>