Lead Capture Tools

nigeld27
Contributor

Making CTA Image Size Responsive

SOLVE

Hello,

 

 

We have embedded our Hubspot CTA into a webpage which isn't built on Hubspot. The CTA is working perfectly except for one factor: the size isn't responsible.

 

Is it possible to make an image CTA responsible? This Knowledge page below suggests that it is possible: If you are embedding an image CTA on your non-HubSpot site, you may need to apply additional CSS declarations (such as width: 100%;) within your stylesheet to make the image CTA responsive.

 

Perhaps this question should be posted in the CMS part of the Community but I can't seem to work out which bit of the CMS codes to change. I'm making changes but it doesn't seem to change anything. I even changed the HTML embed code to say 100% but that isn't working.

 

Can anyone help, please? 

 

0 Upvotes
1 Accepted solution
stefen
Solution
Key Advisor | Partner
Key Advisor | Partner

Making CTA Image Size Responsive

SOLVE

@nigeld27 you'll want to add those styles to your website where the CTA is being embedded. Also, if you don't want to affect any other images on your website you could pinpoint the "hs-cta-img" class like so:

.hs-cta-img {
  max-width: 100%;
  height: auto;
}
Stefen Phelps, Community Champion, Kelp Web Developer

View solution in original post

3 Replies 3
stefen
Key Advisor | Partner
Key Advisor | Partner

Making CTA Image Size Responsive

SOLVE

@nigeld27 do you have a link? Typically, all you would need the following CSS:

img {
  max-width: 100%;
  height: auto;
}
Stefen Phelps, Community Champion, Kelp Web Developer
0 Upvotes
nigeld27
Contributor

Making CTA Image Size Responsive

SOLVE

Thanks Stefan, that's helpful. I hate to sound like completely ignorant but do I change that in the Hubspot embed code or in our website/platform?

0 Upvotes
stefen
Solution
Key Advisor | Partner
Key Advisor | Partner

Making CTA Image Size Responsive

SOLVE

@nigeld27 you'll want to add those styles to your website where the CTA is being embedded. Also, if you don't want to affect any other images on your website you could pinpoint the "hs-cta-img" class like so:

.hs-cta-img {
  max-width: 100%;
  height: auto;
}
Stefen Phelps, Community Champion, Kelp Web Developer