First, keep in mind that both the paragraph and the grid are blocks, so they'll take up all available width. The following drawing represent your current situation:
As you can see, your grid takes the full width, but your columns are set to take up only 40% of the width of the grid. I believe what you want is something like this:
The simplest way to achieve it is giving both the paragraph and the buttons' container an auto
margin and the desired width:
#display,
.buttons {
margin: 0 auto;
width: 400px;
}
But we also have to fix the width of your grid columns. For that, just remove the line grid-template-columns: 10% 10% 10% 10%;
from .buttons
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…