{"id":801,"date":"2024-05-07T11:43:34","date_gmt":"2024-05-07T11:43:34","guid":{"rendered":"https:\/\/kb.shortpixel.com\/docs\/spai-lazy-load-the-backgrounds\/"},"modified":"2025-08-27T08:42:55","modified_gmt":"2025-08-27T08:42:55","password":"","slug":"spai-lazy-load-the-backgrounds","status":"publish","type":"docs","link":"https:\/\/kb.shortpixel.com\/knowledge-base\/article\/spai-lazy-load-the-backgrounds\/","title":{"rendered":"Settings &#8211; Lazy-load the backgrounds"},"content":{"rendered":"<ul>\n<li><strong>Lazy-load the background images from inline STYLE blocks<\/strong>:&nbsp;if you have background images in inline <code>style<\/code> blocks on your HTML page, this option will lazy load them and therefore properly resize them. Example:\n<pre>&lt;html&gt;\n\t&lt;head&gt;\n\t\t&lt;title&gt;ShortPixel&lt;\/title&gt;\n\t\t&lt;style&gt;\n\t\t\tbody {\n\t\t\t\tbackground-image: url(\"https:\/\/www.example.com\/background.jpg\");\n \t\t\t\tbackground-color: #cccccc;\n \t\t\t}\n \t\t&lt;\/style&gt;\n \t&lt;\/head&gt;\n \t&lt;body&gt;\n \t\t... \t\n\t&lt;\/body&gt;\n&lt;\/html&gt;\n\t<\/pre>\n<\/li>\n<li><strong>Lazy-load and resize the background images in TAGS inline styles<\/strong>: if you have background images in the <code>style<\/code> attributes of your HTML tags, this option will lazy load them and therefore properly resize them. Example:\n<pre>&lt;div style=\"background-image:url('https:\/\/www.example.com\/background.jpg')\"&gt;...&lt;\/div&gt;\n\t<\/pre>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Lazy-load the background images from inline STYLE blocks:&nbsp;if you have background images in inline style blocks on your HTML page, this option will lazy load them and therefore properly resize them. Example: &lt;html&gt; &lt;head&gt; &lt;title&gt;ShortPixel&lt;\/title&gt; &lt;style&gt; body { background-image: url(&#8220;https:\/\/www.example.com\/background.jpg&#8221;); background-color: #cccccc; } &lt;\/style&gt; &lt;\/head&gt; &lt;body&gt; &#8230; &lt;\/body&gt; &lt;\/html&gt; Lazy-load and resize the background images [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[35],"glossaries":[],"doc_tag":[],"class_list":["post-801","docs","type-docs","status-publish","hentry","doc_category-shortpixel-adaptive-images"],"blocksy_meta":[],"year_month":"2026-04","word_count":126,"total_views":"808","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"admin","author_nicename":"admin_mdli53m5","author_url":"https:\/\/kb.shortpixel.com\/author\/admin_mdli53m5\/"},"doc_category_info":[{"term_name":"ShortPixel Adaptive Images","term_url":"https:\/\/kb.shortpixel.com\/knowledge-base\/category\/shortpixel-adaptive-images\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/801","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/comments?post=801"}],"version-history":[{"count":1,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/801\/revisions"}],"predecessor-version":[{"id":2462,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/801\/revisions\/2462"}],"wp:attachment":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/media?parent=801"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_category?post=801"},{"taxonomy":"glossaries","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/glossaries?post=801"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_tag?post=801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}