Google-docs – How to make a colored background section like the code section on StackExchange

google docs

I'm looking for a way to create text paragraphs formatted similarly to the way StackExchange sites format code sections:

Example section with background color different from main text's.

Length of individual lines doesn't matter.

I only found how to change the text's background color and it looks more like a highlighter line, with uncolored space between lines of text. And the background color only goes as far as the text does, so each line's length determines how far the background color will go.



How do I make it look as good as it does on StackExchange? Not just on my screen (css tweaks), but when printed on paper too.

Best Answer

In case something like this is suitable:

WA59585 example

it was achieved with insertion of a table of one column and three rows, Table properties... for Table border set to 0pt and a colour chosen for Cell background colour, but then the middle cell selected and the Cell background colour set to None.

Related Topic