The design of the page is barely this:
I want to put Redbox (which has 1 in it) in the middle of "PlayerOneDiv".
And the same for the yellow box for "PlayerTwoDiv".
return (<div className="App">
<div className="sampleDiv" onClick={getData}>
<div className="playerOneScoreDiv">1</div>
<div className="midDiv">
<Box param={pitValue1} funcParam={getData}> b</Box>
</div>
<div className="playerTwoScoreDiv">3</div>
</div>
The style of PlayerOneDiv and the outer div is:
.sampleDiv {
background-color: green;
margin: auto;
width: 60%;
padding: 100px;
border-radius: 14px;
display: flex;
flex-direction: row;
}
.playerOneScoreDiv {
width: 15%;
height: 96px;
display: flex;
align-items: center;
justify-content: center;
font-size: 3rem;
font-weight: bold;
border-radius: 14px;
color: #fff;
margin-right: 4px;
margin-bottom: 4px;
cursor: default;
background-color: red;
}
When I play with PlayerOneDiv, the number "1" is shifting in the box but I could not shift the box itself into mid of the div.
Which property do I need to change or should I need to add another wrapper div?
