#svg-grid { display: flex; flex-wrap: wrap; gap: 16px; /* space between grid items */ justify-content: center; /* center items horizontally */ } .grid-item { flex: 1 1 150px; /* grow, shrink, base width */ max-width: 200px; padding: 8px; box-sizing: border-box; background-color: #f9f9f9; border: 1px solid #ddd; border-radius: 8px; text-align: center; } .grid-item:hover { background-color: #999999; } .selected { background-color: #777777; }