How to make Blogger theme Responsive Images with CSS Code

Blooger. theme Customise CSS Code responsive images



 Here is the CSS code you can use to make images responsive on your Blogger blog.

Responsive Images CSS

This simple CSS snippet will ensure that all images automatically resize to fit within the width of their container, while maintaining their correct aspect ratio to prevent distortion.

CSS
img {
  max-width: 100%;
  height: auto;
}

How to Add the CSS to Your Blogger Blog

To implement this, follow these steps in your Blogger dashboard:

  1. Go to your Blogger dashboard and click on Theme in the left-hand menu.

  2. Click the down arrow next to the Customize button and select Edit HTML.

  3. Alternatively, you can go to Customize and then click on Advanced followed by Add CSS.

  4. Copy and paste the code above into the custom CSS box.

  5. Click the Save icon to apply the changes.

The max-width: 100% property ensures the image will never be wider than its parent element, and height: auto automatically adjusts the image's height to maintain its original proportions.

You're likely encountering an issue with the Blogger theme's custom CSS functionality, which is a known problem for some templates, including Essential. It's often a bug where the "Add CSS" feature in the customizer doesn't reliably save changes. The custom CSS code may be correctly applied to the blog, but it gets wiped from the editor itself, which can be confusing.

Blogger not saving CSS code possible Reasons & Solutions

  • Blogger's "Add CSS" Bug: The most probable reason is a known bug in Blogger's theme customization editor. You might add the CSS, save it, and see that it works on your blog, but the next time you open the custom CSS box, the code is gone. This doesn't mean it's not working; it just means the editor isn't storing it correctly.

  • HTML & Custom CSS Conflict: Sometimes, a theme's code can conflict with the way the customizer's "Add CSS" section saves rules. The most reliable method is to add the CSS directly to the theme's HTML file. This bypasses the buggy customizer feature and ensures the code is permanently saved.

How to Fix It 🛠️

To ensure the responsive images CSS is permanently saved, add it directly into the theme's HTML.

  1. Go to your Blogger dashboard and click Theme.

  2. Click the down arrow next to the Customize button and select Edit HTML.

  3. In the code editor, look for the closing <b:skin> tag. This is where the theme's default CSS ends. You can use Ctrl + F (or Cmd + F on Mac) to find it.

  4. Paste the following responsive images CSS code right before the </b:skin> tag:

    CSS
    img {
      max-width: 100%;
      height: auto;
    }
    
  5. Click the Save icon at the top right of the editor.

This method will hard-code the CSS into your theme's template, so it will always be there, regardless of any issues with the customizer's save function.


Gone Viral

UAP ALERT? Massive 12-Mile-Wide Craft '3I/ATLAS' Barreling Toward Earth – Probes Incoming

Albanese Visits Sheikh Zayed Mosque: Peace and Unity Symbol

Tensions Rise as Police Move to Block Pro-Palestine March at Sydney Opera House

Victoria's Migrant Gangs Wield Machetes in a Nightmare of No Return