Bear Awareness (in Grid Form)

A common way to lay out a list of visual things is a grid like above.

This one may be difficult. Especially since you have to use this markup:

<ul class="images">
    <li>
        <figure>
            <a href="#">
                <img src="https://placebear.com/300/200">
                <figcaption>Be Aware of the Bear</figcaption>
            </a>
        </figure>        
    </li>
    <li>
        <figure>
            <a href="#">
                <img src="https://placebear.com/300/201">
                <figcaption>Smokey</figcaption>
            </a>
        </figure>  
    </li>

    <li>
        <figure>
            <a href="#">
                <img src="https://placebear.com/300/202">
                <figcaption>Gone Fishin</figcaption>
            </a>
        </figure>  
    </li>

    <li>
        <figure>
            <a href="#">
                <img src="https://placebear.com/301/203">
                <figcaption>I'm stuck</figcaption>
            </a>
        </figure>        
    </li>
    <li>
        <figure>
            <a href="#">
                <img src="https://placebear.com/305/205">
                <figcaption>PDA?</figcaption>
            </a>
        </figure>  
    </li>

    <li>
        <figure>
            <a href="#">
                <img src="https://placebear.com/301/202">
                <figcaption>Hello?</figcaption>
            </a>
        </figure>  
    </li>
</ul>

Notes

The images are from placebear.com. It's exactly what it sounds like it is. There's also placekitten.com, if you want to make "I can haz placeholder art" jokes.

For Bonus Points

Right now, if there were a 7th image, it would hang on the left. What if you wanted it centered?

Perhaps, rather than floating, you could make a layout like this where the li's are inline-blocks, and set text-align:center; on the parent, so if there's 3 the fill the row, but if there's 1 or 2 they're centered across the row.

I bet that would work 😉