Uma opção para resolver o problema de grid é:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Alurinha | Cursos online</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="grid">
<div class="box">Ruby on Rails</div>
<div class="box">Java</div>
<div class="box">HTML</div>
<div class="box">Python</div>
<div class="box">Wordpress</div>
<div class="box">Bootstrap</div>
<div class="box">Java Web</div>
<div class="box">MySQL</div>
</div>
</body>
No style.css inserimos:
.grid{
display: flex;
flex-wrap: wrap;
}
.box {
height: 50px;
width: 23%;
margin: 1%;
background-color: rosybrown;
color: aliceblue;
display: flex;
justify-content: center;
align-items: center;
}
.box:nth-child(4n) {
margin-right: 0;
}
.box:nth-child(4n + 1) {
margin-left: 0;
}