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.](https://cms.theadhocracy.co.uk/assets/theadhocracy/Notes/how-to-change-the-background-colour-of-a-word-in-indesign/indesign-bg-colour-word.png)