Can we use images in CSS background in Google AMP?

Rakib Uzzaman picture Rakib Uzzaman · Aug 18, 2017 · Viewed 8.7k times · Source

Can we use images in CSS background in Google AMP?

<pre>

    <div style="background-image: url(assets/img/business1.jpg);></div>


</pre>

Answer

Bachcha Singh picture Bachcha Singh · Aug 22, 2017

You can do like this :

CSS on head section

<style amp-custom>
    .img-background { background-image: url(assets/img/business1.jpg); }
</style>

HTML

<pre>
<div class="img-background"></div>
</pre>