I'm dealing with a situation like this:
.center_position_div{
width:100%;
background-color:green;
display: flex;
flex-wrap: wrap;
}
.show_running_exam
{
width: 22%;
background-color:aliceblue;
margin-left: 1%;
margin-right: 1%;
margin-bottom: 5px;
margin-top: 6px;
overflow: hidden;
}
<div class="center_position_div">
<div class="show_running_exam">saddsdsadsdsdf dsfsdfd sfdsfdsfsdfd sfdsfsd</div>
<div class="show_running_exam">saddsdsadsdsdf dsfsdfd sfdsfdsfsdfd sfdsfsd</div>
<div class="show_running_exam">saddsdsadsdsdf dsfsdfd sfdsfdsfsdfd sfdsfsd</div>
<div class="show_running_exam">saddsdsadsdsdf dsfsdfd sfdsfdsfsdfd sfdsfsd</div>
<div class="show_running_exam">saddsdsadsdsdf dsfsdfd sfdsfdsfsdfd sfdsfsd</div>
<div class="show_running_exam">saddsdsadsdsdf dsfsdfd sfdsfdsfsdfd sfdsfsd</div>
<div class="show_running_exam">saddsdsadsdsdf dsfsdfd sfdsfdsfsdfd sfdsfsd</div>
<div class="show_running_exam">saddsdsadsdsdf dsfsdfd sfdsfdsfsdfd sfdsfsd</div>
<div class="show_running_exam">saddsdsadsdsdf dsfsdfd sfdsfdsfsdfd sfdsfsd</div>
<div class="show_running_exam">saddsdsadsdsdf dsfsdfd sfdsfdsfsdfd sfdsfsd</div>
</div>
Is there a way to center the child divs within the parent div without using "padding-left" or "margin: 0 auto;"? I've tried those but they're not working. Any other suggestions to achieve this?