DEV Community

Valeri-CSS
Valeri-CSS

Posted on

How To Center An Elements With CSS Grid

Hello Everyone I am Valeri and I am beginner web Developer, Please Help Me ))))

Which Grid Property must I write, that the Element which is on the underline to place in the middle not on the left side?

See the HTML/CSS code and the Screenshot.

<div class="description-content">
<div class="content">
<h3>10</h3>
<p>Training courses in various areas of robotics</p>
</div>
<div class="content">
<h3>20</h3>
<p>Schools that have launched robotics</p>
</div>
<div class="content">
<h3>100</h3>
<p>Teachers who have completed advanced training courses</p>
</div>
<div class="content">
<h3>10 000</h3>
<p>Trained children at our own centers</p>
</div>
</div>

.description-content {
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
display: grid;
margin-top: 40px;
margin-bottom: 40px;
text-align: center;
}

Image description

Top comments (0)