How to change the background colour of a word in InDesign | Stack Exchange

I'm using InDesign increasingly it seems and overall I really dig it, but I recently ran into a fairly simple problem that doesn't have an official solution: inline code styling. It's pretty much a standard these days to highlight inline code with a background colour, something like this: <strong>. However, InDesign doesn't allow you to set background fill for a single word (or partial string of any kind).

Luckily, there is a workaround, which I found thanks to the user Wolff over on Stack Exchange. You use a ridiculously large underline effect to mimic a background (with non-breaking spaces for additional padding). Just select the word or phrase, go to the Character Style menu and edit the Underline Options like so:

Screenshot of Character Style Options panel in InDesign, with Underline Options selected. Underline is checked to "on", weight has a value of "13pt", type is a bold line, tint 100%, and color is set to a green. All other options are deselected.
Little tip: whilst setting up your inline code style, don't forget to save it. Makes applying it throughout a document incredibly simple.

Explore Other Notes

Made By Me, But Made Possible By:


Build: Gatsby

Deployment: GitHub

Hosting: Netlify

Connect With Me:

Twitter Twitter

Instagram Instragram

500px 500px

GitHub GitHub

Keep Up To Date:

All Posts RSS feed.

Articles RSS feed.

Journal RSS feed.

Notes RSS feed.