I am not super techie but I understand my way in the templates pretty well but I’m feeling stuck.
I’m currently using the free version of HubSpot and migrating my website content. I’m using a free template (called Focus) to build my site and everything makes sense except the image grid. The image grid is a default from HubSpot with no customization and it creates images that are rectangular and wide. My images are round with a transparent background so they get cut off on top and bottom.
I’d accept either making the rows taller (so that the full white circle is visible) or customizing the image container itself to be round.
Would this be available in the ratio calculations?
{% set ratio_calculations = {
'3/2': 1.5,
'2/3': 0.66666667,
'4/3': 1.33333333,
'3/4': 0.75,
'16/9': 1.77777778
} %}
Thanks in advance for the help!
Hi @PearlGirl
The best way to do this is using CSS, in particular this should work:
.hs-image__grid__list__item,
.hs-image__grid__list__item__image {
aspect-ratio: 1/1;
border-radius: 50%;
}
The Image Grid module’s settings already get you half way by letting you set the aspect ratio. Under the Content tab, click into Settings > Aspect ratio and choose “1:1” and that will give you square images.
There is an option to set the grid image’s corners from the Styles tab > Grid images > Corner but unfortunately it only goes up to 100px, whereas we want it to be 50% to make the images round.
If you’re comfortable coding you could clone the module and update the field and it’s corresponding CSS to use “%”.
Alternatively, the quickest solution is to go to the page’s Settings tab and, under Advanced options > Head HTML, add in the following code:
<style>
.hs-image__grid__list__item,
.hs-image__grid__list__item__image {
border-radius: 50%;
}
</style>
(Make sure you haven’t set the “Corner” from settings or it’ll override the above unless you add an !important declaration).
I hope that helps!