How to format text to looks like code in wordpress like stackoverflow {} tool?

I need to format text in posts using WordPress to look like a code. Like here in stackoverflow we use { } to separate the code from the text. I need to do the same when I write my blogs in WordPress

Example ....
code will look like that !

Related posts

Leave a Reply

3 comments

  1. WordPress has a preformatted paragraph style that works OK without any plugins. Just select the text and then select the Preformatted style on the left side of the formatting bar:

    Illustration showing Preformatted paragraph style in WordPress

    I had installed a plugin, but then found this simpler and it works fine for my purposes.