Streaming live at 10am (PST)

Custom css with html embed


#1

I want the pictures i get from the a link in my CMS to cover the div block. I have the html embed at 100%x100% inside another div block. Can someone tell me where i went wrong? Look at the pictures below. Thank you so much!




#2

Good question, @Stig_Ark.

Could you provide your sites read-only link: https://university.webflow.com/article/sharing-your-sites-read-only-link

I’d be happy to take a look to see if I can help :blush:


#3

@micahryanhtml

here is the link: https://preview.webflow.com/preview/artistpartner?preview=6b7b6f740455a55683c2996a00ae7ee9

And the page thats in question is the page “aktuelt”


#4

I would suggest uploading those images to your collection, and using the the collections option to use the image as a background image:
webflow-background-image-cms

Hopefully this helps :blush:


#5

@micahryanhtml The thing is, i am getting these URL´s from zapier RSS feed from a facebook page. And zapier do not import pictures, thats why i import the links. :S


#6

@Stig_Ark Gotcha.

Okay, you would need to change the structure to the following so that the URL used is placed in the div’s background. Please note that you will need to enter in a specific height, and I would suggest adding this to the head via a class if you need to add media-queries:
<div style="height:100px;background-image: url(Bilde);background-size: cover;background-position: center;background-repeat: no-repeat;"></div>


#7

by BG the answer above.

If you want by <img> (better for seo) this code works fine. Anyway remember to upload better Q images + :::::::: Also its better to also add alts

<div class="image123">
  <img style="width: 100%; height: auto;" src="{{img}}" alt={{alt}} />
 </div> 

“where i went wrong” Embed is already 100% (a div) - but you should style the content inside.

If you want “img” behave like “cover” - this is more tricky - try this ideas:


#8

@Siton_Systems and @micahryanhtml Thank you so much for the help guys! :slight_smile: