ShareYourGroupShareYourGroupBlogger Guides

How to edit HTML and add CSS in Blogger safely

Blogger lets you edit the theme code. Do it in small steps, with a backup, and look at the result each time.

Where the code is

Edit the HTML of the whole theme. In the left menu click Theme. Under "My theme" click More, then Edit HTML. Make your change and click Save.

Add CSS only. In Theme, click Customize, then Advanced in the left menu, then the down arrow beside Add CSS. Type your code and click Save at the bottom right.

Adding CSS is the safer of the two: you do not touch the structure of the theme, and removing your code undoes the change. Use it for colours, spacing, fonts and hiding things.

A safe routine

  1. Download a backup of the theme (see the backup page).
  2. Make one change.
  3. Save and open the blog in a second tab (not the preview only). Look at the home page, a post and a page.
  4. If the page broke, undo the change at once, or restore the backup.
  5. Only then make the next change.

Blogger's own warning applies: Google claims no ownership or control over content or code that authors add, and authors who add code or third-party widgets do so at their own risk. Never paste code that you do not understand, especially scripts from unknown sites.

Examples of CSS you can add

.post-title { font-size: 1.6rem; line-height: 1.3; }
.post-body img { max-width: 100%; height: auto; }
.post-body { line-height: 1.7; }

The class names depend on the theme. Right-click the part of the page in your browser and choose Inspect to see its real class name, then write the rule for that name.

When the code breaks the blog

Blogger's troubleshooting page lists these checks:

Good habits

Why does my CSS not change anything?

The rule may be less specific than the theme's own, or the class name is wrong. Inspect the element in your browser and match the name; add a more specific selector if needed.

Is it safe to paste a widget from another site?

Only from sources you trust. A widget is code that runs on your pages and can read what your visitors do.

Sources

Read on 13 November 2026. Steps and screen names can change; compare with the current help page.

This is an independent guide. It is not connected with Google or Blogger. Blogger, AdSense and Google are names of Google LLC. The steps follow Blogger Help and AdSense Help as read on 13 November 2026; the Blogger screens change from time to time, so a menu may be named a little differently on your screen.