I'm trying to center the bottom two li items (restaurant info containers in the image below) in a ul list that is set to display: grid
. I thought adding justify-items: center
to the ul list ruleset would work, but it didn't. I also tried justify-content: center
, which didn't change anything. Is there a solution that works with CSS grid that would the items in the last row?
<ul id="restaurants-list"></ul>
/* ul element */
#restaurants-list {
background-color: #f3f3f3;
list-style: outside none none;
margin: 0;
padding: 30px 15px 30px;
display: grid;
grid-gap: 20px;
justify-items: center;
}
#restaurants-list li {
background-color: #fff;
border: 2px solid #ccc;
font-family: Arial, sans-serif;
padding: 10px;
max-width: 270px;
}