What is the difference between display:grid;
and display:inline-grid;
?
They both have the same effect in this code. Which one is better to use, in this code?
<body>
<main>
<p>box1</p>
<p>box2</p>
<p>box3</p>
<p>box4</p>
</main>
</body>
* {
margin: 0px;
padding: 0px;
border: 0px;
box-sizing: border-box;
}
main {
display: grid; /* Not there */
grid-template-columns: repeat(4, 1fr);
grid-template-rows: 100px;
grid-gap: 20px;
}
p {
background-color: #eee;
/* In there */
display: grid; /* inline-grid */
place-items: center;
}