Streaming live at 10am (PST)

Add styles in HTML


#1

Is possible to add to a div html code like this:

<div class="gratis-div" style="background-size:cover;background-image:url(https://www.zukunftsblick.de/design/images/shutterstock_402485005_sergey_nivens.jpg)">

i want to add:

style="background-size:cover;background-image:url(https://www.zukunftsblick.de/design/images/shutterstock_402485005_sergey_nivens.jpg);"


#2

Yes, you can put any valid HTML inside the Embed Code component.

https://university.webflow.com/article/embed


#3

You could also insert the div in Webflow and give it an ID, set “cover”. Then set the background with Javascript.

> <script>
> document.getElementById("my-id").style.backgroundImage = "url('https://www.zukunftsblick.de/design/images/shutterstock_402485005_sergey_nivens.jpg')"
> </script>

This way you can see the element in Webflow Designer.


#4

Where is the Embed Code component?


#5