For a block of text enclosed in a colored background (like the example below), you can use this code (in the html post or page editor, or in text widgets):
Padding = space around text; “line-height” may or may not be needed (to correct line spacing, in case it gets disrupted in the theme you’re using). Both numbers are just examples – you can change them.
To highlight a word or a phrase within a paragraph, like this, you can use this variant:
For a bordered background see this post.