Apr 27, 2020 3:50 PM
Hi! I know basic CSS and HTML, but HubL is confusing as heck to me, to give you an idea of my abilities.
We are trying to take the post listing page and pull the featured image and title of the first few posts to display on our main domain. However, there's something enforcing a max-width of 50% on the featured image and I can't tell what it is - it's not our stylesheet, it's not the browser, and I can't even tell if it's on Hubspot's end or where I might find it. I've trawled through the Design Manager "control+F"-ing for .hs-featured-image and max-width to no avail.
Attached is a screenshot of the inspector tool results but you can also see it yourself at blog.bellinghamelectric.com/blog/
Appreciate any info you can offer. Thanks!
Apr 27, 2020 4:01 PM - edited Apr 27, 2020 6:16 PM
I believe that HubSpot is outputting some default styles directly to a <style> tag on the page. I am not aware of a way to prevent this from occuring. Edit to add: viewing source, you can see a <style> tag with some css for default HubSpot items - I've checked a few other sites on HubSpot and see the same there as well, indicating that it is a default behaviour of HubSpot.
If you want to edit this, you would need to declare the .hs-featured-image class in your CSS and add your styles, or you could change the class name on the image to one of your choosing and define the styles for that new class.
Apr 30, 2020 10:22 AM - edited May 5, 2020 2:40 PM
Thank-you! Adding a max-width setting fixed the issue. Although, interestingly, max-width seems to override a "width: 50%" setting on the same class in the stylesheet even though it seems like it should only override if width is trying to exceed max-width.
Edit: Well, it fixed the formatting on the Hubspot end but not what showed up on the other end... Our best guess is that the XML code is pulling info from the RSS feed, and that RSS feed is setting the hardline code of 50% width.
Wanted to clarify this in case someone else is trying to do the same thing.
Apr 27, 2020 5:37 PM