{"id":32812,"date":"2024-02-12T07:00:00","date_gmt":"2024-02-12T15:00:00","guid":{"rendered":"https:\/\/cloudinary.com\/blog\/?p=32812"},"modified":"2025-10-16T11:06:06","modified_gmt":"2025-10-16T18:06:06","slug":"transparent-effect-background-images-css-opacity","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity","title":{"rendered":"Creating a Transparent Effect on Background Images With CSS Opacity and Cloudinary"},"content":{"rendered":"\n<p>Adding a background pattern or image to a website makes it more visually appealing and creates a strong brand impression. But we don&#8217;t want the background image to be too distracting, especially when text is overlaid on top. In this case, we can apply a transparent effect to the background image to make it less distracting and the text more readable.&nbsp;<\/p>\n\n\n\n<p>This blog post explores how to handle CSS background image opacity to create a transparent effect using different HTML techniques. Plus as a bonus, you\u2019ll learn how Cloudinary\u2019s free opacity transformation feature makes working with background image opacity even easier.As we discuss ways to set background image opacity in CSS we\u2019ll cover:<\/p>\n\n\n\n<p>You\u2019ll learn:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>How to set up the page.<\/li>\n\n\n\n<li>How to create css background image transparency with the CSS <code>opacity<\/code> property.<\/li>\n\n\n\n<li>How to use the <code>background<\/code> property.<\/li>\n\n\n\n<li>The drawbacks of using CSS background image opacity.<\/li>\n\n\n\n<li>Transparent backgrounds with Cloudinary\u2019s <code>opacity<\/code> transformation.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Setting Up the Page<\/strong><\/h2>\n\n\n\n<p>Our goal is to create a simple page that contains the following html background image opacity elements:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A website background from an image, with a transparency effect of 50%.<\/li>\n\n\n\n<li>A heading text.<\/li>\n\n\n\n<li>A small paragraph text below the heading text.<\/li>\n<\/ul>\n\n\n\n<p>Our HTML code will look like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">body<\/span>&gt;<\/span>\n\n\u00a0\u00a0\u00a0<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"background\"<\/span>&gt;<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">img<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"https:\/\/res.cloudinary.com\/mayashavin\/image\/upload\/v1702370398\/Hippopy\/Arts\/ninja_assassin\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"background-image\"<\/span>&gt;<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">main<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"content\"<\/span>&gt;<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h1<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"heading\"<\/span>&gt;<\/span>Some text heading<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h1<\/span>&gt;<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"paragraph\"<\/span>&gt;<\/span>Some text paragraph<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">p<\/span>&gt;<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">main<\/span>&gt;<\/span>\n\n\u00a0\u00a0<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">body<\/span>&gt;<\/span>\n\nWith the following CSS stylings:\n\n.background-image {\n\nwidth: 500px;\n\n}\n\n.content {\n\npadding: 20px 0px;\n\nmargin: auto;\n\ndisplay: block;\n\ntext-align: center;\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>At this point, the browser will display the page with the background image and the text elements.<\/p>\n\n\n\n<p>To make the image appear behind the text elements as background, we\u2019ll perform the following on the CSS selector <code>.background-image<\/code>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set the <code>position<\/code> property to <code>absolute<\/code>.<\/li>\n\n\n\n<li>Set the <code>z-index<\/code> property to <code>-1<\/code>.<\/li>\n\n\n\n<li>Set `width` to cover the whole page (<code>100%<\/code>).<\/li>\n<\/ul>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\"><span class=\"hljs-selector-class\">.background-image<\/span> {\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-attribute\">position<\/span>: absolute;\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-attribute\">width<\/span>: <span class=\"hljs-number\">100%<\/span>;\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-attribute\">z-index<\/span>: -<span class=\"hljs-number\">1<\/span>;\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>By doing so, you take the <code>img<\/code> element out of the standard page flow and position it relatively to one of its closest positioned ancestors (in this case, <code>body<\/code>). The <code>z-index<\/code> property specifies the stack order of the element, and a value of <code>-1<\/code> indicates placing the element behind the text elements.<\/p>\n\n\n\n<p>Though the text contrast looks good, the background image&#8217;s color is too intense and distracting. Let&#8217;s make it more transparent!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Creating Transparency With the CSS Background Image <code>opacity<\/code> Property<\/h2>\n\n\n\n<p>The most straightforward way to create transparency is using the CSS <code>opacity<\/code> property. The syntax is opacity: [value];. The <code>value<\/code> can be between 0 (fully transparent) and 1 (fully opaque). In our demo, let&#8217;s set the <code>opacity<\/code> property to <code>0.5<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">.background-image {\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-comment\">\/\/...<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-attr\">opacity<\/span>: <span class=\"hljs-number\">0.5<\/span>;\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>With this change, the browser will display the <a href=\"https:\/\/cloudinary.com\/background-remover\">background image<\/a> with 50% transparency.<\/p>\n\n\n\n<p>The image looks better, but there is one problem with our current approach of using the <code>img<\/code> element for the background image. We need it to be responsive, i.e., it should resize itself to fit the screen size or the page&#8217;s content. Unfortunately, the <code>img<\/code> element doesn\u2019t resize itself automatically, and we may need to set the <code>width<\/code> property to <code>100%<\/code> or <code>height<\/code> to <code>100%<\/code> to make it responsive.&nbsp;<\/p>\n\n\n\n<p>However, doing so will cause the image to stretch and look distorted. So let\u2019s explore a better way to create a responsive background image with a transparency effect.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Using the <code>background<\/code> Property<\/strong><\/h2>\n\n\n\n<p>Instead of using the <code>img<\/code> element, we can use the CSS <code>background<\/code> property to set the background image of a component. We\u2019ll change our <code>img<\/code> to an empty <code>div<\/code> as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">&lt;body&gt;\n\n\u00a0\u00a0\u00a0<span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"background\"<\/span>&gt;<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"background-image\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-comment\">&lt;!--...--&gt;<\/span>\n\n\u00a0\u00a0<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span><\/span>\n\nAdd the following CSS rules to <span class=\"hljs-string\">`.background-image`<\/span>:\n\n.background-image {\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-comment\">\/\/...<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-attr\">width<\/span>: <span class=\"hljs-number\">100<\/span>%;\n\n\u00a0\u00a0\u00a0\u00a0height: <span class=\"hljs-number\">100<\/span>%;\n\n\u00a0\u00a0\u00a0\u00a0background: url(https:<span class=\"hljs-comment\">\/\/res.cloudinary.com\/mayashavin\/image\/upload\/v1702370398\/Hippopy\/Arts\/ninja_assassin) center;<\/span>\n\n\u00a0\u00a0\u00a0\u00a0background-size: contain;\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The value <code>contain<\/code> for <code>background-size<\/code> specifies that the background image should be scaled as large as possible while ensuring its dimensions are less than or equal to the corresponding width and height of the background positioning area. By default, the browser will repeat the background image to fill the space left during the background scaling.<\/p>\n\n\n\n<p>With this, we can ensure the background image will always be responsive and fit the screen size without stretching out of its original size.<\/p>\n\n\n\n<p>But is using the opacity property the ideal way to create transparent background images, or is there another way?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>The Drawbacks of Using the CSS <code>opacity<\/code> Property<\/strong><\/h2>\n\n\n\n<p>The CSS <code>opacity<\/code> property is a great way to create a transparency effect on an element. Its drawback is that it affects the entire element, which means it also counts any nested elements.<\/p>\n\n\n\n<p>In our demo, we separated the background image <code>div<\/code> and the <code>main<\/code> content into two sibling elements. We used CSS positioning and stacking order as the workaround to have one displayed behind another, keeping the complete opacity of content in <code>main<\/code>. If we wrap the `main` within <code>div.background-image<\/code>, the entire <code>main<\/code> content will inherit the <code>opacity<\/code> property of <code>.background-image<\/code>.<\/p>\n\n\n\n<p>Since the <code>background-opacity<\/code> property in CSS only allows us to apply the transparency effect to the background image, we used a workaround solution of combining CSS positioning and stacking order, which is the best CSS-only solution.<\/p>\n\n\n\n<p>Or, if we want something just as easy but with far more flexibility, we can use Cloudinary&#8217;s <code>opacity<\/code> transformation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Change Background Image <code>opacity<\/code> CSS With Cloudinary<\/h2>\n\n\n\n<p><a href=\"https:\/\/cloudinary.com\/\">Cloudinary\u2019s<\/a> <code>opacity<\/code> transformation allows us to create a variant of our image with the desired opacity effect on the fly. To do so, we can add the <code>o_&lt;opacity-level&gt;<\/code> parameter to the image&#8217;s Cloudinary URL after <code>\/upload\/<\/code>, where <code>&lt;opacity-level&gt;<\/code> is a number between 0 (fully transparent) and 100 (fully opaque).<\/p>\n\n\n\n<p>Let&#8217;s take our demo URL image and add the <code>o_50<\/code> parameter as 50% transparency to it and safely remove CSS <code>opacity<\/code>, <code>position<\/code>, and <code>z-index<\/code> from <code>.background-image<\/code>, as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\"><span class=\"hljs-selector-class\">.background-image<\/span> {\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-attribute\">width<\/span>: <span class=\"hljs-number\">100%<\/span>;\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-attribute\">height<\/span>: <span class=\"hljs-number\">100%<\/span>;\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-attribute\">background<\/span>: <span class=\"hljs-built_in\">url<\/span>(https:\/\/res.cloudinary.com\/mayashavin\/image\/upload\/o_50\/v1702370398\/Hippopy\/Arts\/ninja_assassin) center;\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-attribute\">background-size<\/span>: contain;\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Now, we can have the `main` content nested within `div.background-image` without worrying about the transparency effect applied to it.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"background\"<\/span>&gt;<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"background-image\"<\/span>&gt;<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">main<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"content\"<\/span>&gt;<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h1<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"heading\"<\/span>&gt;<\/span>Some text heading<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h1<\/span>&gt;<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"paragraph\"<\/span>&gt;<\/span>Some text paragraph<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">p<\/span>&gt;<\/span>\n\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">main<\/span>&gt;<\/span>\n\n\u00a0\u00a0\u00a0\u00a0<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n\u00a0\u00a0<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>That&#8217;s all it takes. The output will be similar to our CSS workaround but with less code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Closing Thoughts<\/h2>\n\n\n\n<p>We learned that the CSS <code>opacity<\/code> property isn\u2019t the best solution for creating a transparent background image without other CSS properties like <code>position<\/code>, stack order <code>z-index<\/code>, and a proper HTML structure. An excellent alternative is combining the dynamic opacity transformation on the URL of Cloudinary images with the correct CSS <code>background<\/code> property, creating a transparent background image with less code.<\/p>\n\n\n\n<p>Enhance your website&#8217;s visuals using Cloudinary\u2019s transformations to create striking, engaging imagery. <a href=\"https:\/\/cloudinary.com\/users\/register_free\">Sign up for free today.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Adding a background pattern or image to a website makes it more visually appealing and creates a strong brand impression. But we don&#8217;t want the background image to be too distracting, especially when text is overlaid on top. In this case, we can apply a transparent effect to the background image to make it less [&hellip;]<\/p>\n","protected":false},"author":87,"featured_media":32814,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[75,165],"class_list":["post-32812","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-css","tag-image-transformation"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Change Background Image Opacity in CSS<\/title>\n<meta name=\"description\" content=\"Learn how to use CSS background image opacity to adjust transparency for background images to create beautiful web pages.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating a Transparent Effect on Background Images With CSS Opacity and Cloudinary\" \/>\n<meta property=\"og:description\" content=\"Learn how to use CSS background image opacity to adjust transparency for background images to create beautiful web pages.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-12T15:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-16T18:06:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1707510741\/background_transparency_CSS-Blog\/background_transparency_CSS-Blog.jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"2000\" \/>\n\t<meta property=\"og:image:height\" content=\"1100\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"melindapham\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"NewsArticle\",\"@id\":\"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity\"},\"author\":{\"name\":\"melindapham\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/person\/0d5ad601e4c3b5be89245dfb14be42d9\"},\"headline\":\"Creating a Transparent Effect on Background Images With CSS Opacity and Cloudinary\",\"datePublished\":\"2024-02-12T15:00:00+00:00\",\"dateModified\":\"2025-10-16T18:06:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity\"},\"wordCount\":957,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1707510741\/background_transparency_CSS-Blog\/background_transparency_CSS-Blog.jpg?_i=AA\",\"keywords\":[\"CSS\",\"Image Transformation\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2024\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity\",\"url\":\"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity\",\"name\":\"How to Change Background Image Opacity in CSS\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1707510741\/background_transparency_CSS-Blog\/background_transparency_CSS-Blog.jpg?_i=AA\",\"datePublished\":\"2024-02-12T15:00:00+00:00\",\"dateModified\":\"2025-10-16T18:06:06+00:00\",\"description\":\"Learn how to use CSS background image opacity to adjust transparency for background images to create beautiful web pages.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1707510741\/background_transparency_CSS-Blog\/background_transparency_CSS-Blog.jpg?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1707510741\/background_transparency_CSS-Blog\/background_transparency_CSS-Blog.jpg?_i=AA\",\"width\":2000,\"height\":1100},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating a Transparent Effect on Background Images With CSS Opacity and Cloudinary\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudinary.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/person\/0d5ad601e4c3b5be89245dfb14be42d9\",\"name\":\"melindapham\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e6f989fa97fe94be61596259d8629c3df65aec4c7da5c0000f90d810f313d4f4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e6f989fa97fe94be61596259d8629c3df65aec4c7da5c0000f90d810f313d4f4?s=96&d=mm&r=g\",\"caption\":\"melindapham\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Change Background Image Opacity in CSS","description":"Learn how to use CSS background image opacity to adjust transparency for background images to create beautiful web pages.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity","og_locale":"en_US","og_type":"article","og_title":"Creating a Transparent Effect on Background Images With CSS Opacity and Cloudinary","og_description":"Learn how to use CSS background image opacity to adjust transparency for background images to create beautiful web pages.","og_url":"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity","og_site_name":"Cloudinary Blog","article_published_time":"2024-02-12T15:00:00+00:00","article_modified_time":"2025-10-16T18:06:06+00:00","og_image":[{"width":2000,"height":1100,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1707510741\/background_transparency_CSS-Blog\/background_transparency_CSS-Blog.jpg?_i=AA","type":"image\/jpeg"}],"author":"melindapham","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity"},"author":{"name":"melindapham","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/person\/0d5ad601e4c3b5be89245dfb14be42d9"},"headline":"Creating a Transparent Effect on Background Images With CSS Opacity and Cloudinary","datePublished":"2024-02-12T15:00:00+00:00","dateModified":"2025-10-16T18:06:06+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity"},"wordCount":957,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1707510741\/background_transparency_CSS-Blog\/background_transparency_CSS-Blog.jpg?_i=AA","keywords":["CSS","Image Transformation"],"inLanguage":"en-US","copyrightYear":"2024","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity","url":"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity","name":"How to Change Background Image Opacity in CSS","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1707510741\/background_transparency_CSS-Blog\/background_transparency_CSS-Blog.jpg?_i=AA","datePublished":"2024-02-12T15:00:00+00:00","dateModified":"2025-10-16T18:06:06+00:00","description":"Learn how to use CSS background image opacity to adjust transparency for background images to create beautiful web pages.","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1707510741\/background_transparency_CSS-Blog\/background_transparency_CSS-Blog.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1707510741\/background_transparency_CSS-Blog\/background_transparency_CSS-Blog.jpg?_i=AA","width":2000,"height":1100},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/transparent-effect-background-images-css-opacity#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Creating a Transparent Effect on Background Images With CSS Opacity and Cloudinary"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/person\/0d5ad601e4c3b5be89245dfb14be42d9","name":"melindapham","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e6f989fa97fe94be61596259d8629c3df65aec4c7da5c0000f90d810f313d4f4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e6f989fa97fe94be61596259d8629c3df65aec4c7da5c0000f90d810f313d4f4?s=96&d=mm&r=g","caption":"melindapham"}}]}},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1707510741\/background_transparency_CSS-Blog\/background_transparency_CSS-Blog.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/32812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/87"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=32812"}],"version-history":[{"count":6,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/32812\/revisions"}],"predecessor-version":[{"id":38794,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/32812\/revisions\/38794"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/32814"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=32812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=32812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=32812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}