Select to view content in your preferred language

How can I center these three cards with css?

133
3
Friday
BrandonPrice1
Frequent Contributor

Hello,

I customized these three cards on this page with CSS: https://trees-lacounty.hub.arcgis.com/pages/tools-&-resources#related_sites. Although they are no longered centered. What CSS styling can I use to re-center it?

BrandonPrice1_0-1756515728119.png

-Brandon

 

Tags (2)
0 Kudos
3 Replies
croush2024
Occasional Contributor

Is this in a gallery? I would add spacer cards on either side of the gallery. The width of the spacer can be adjusted by hovering over the side and clicking the arrow. Note that spacer cards have the option to be ignored for mobile devices.

0 Kudos
KlaraSchmitt
Esri Regular Contributor

If you're okay with those cards being slightly wider, you could also remove the 'col-lg-3' in your code, which would mean that the medium breakpoint of 3 cards, 4 columns wide (col-md-4) would apply to these and they'd stretch to fill the space of the 12-column grid. 

0 Kudos
croush2024
Occasional Contributor

In case it is helpful, I'll mention that I have centered three buttons with code that starts with:

<div class="row" style="text-align:center">
<div class="col-xs-12 col-sm-4">...

Your page is quite a bit more complex, so I'm not sure to which div to apply text-align:center or whether you might need a new div layer if using this method.

0 Kudos