Code and Verse
WordPress provides three block types to handle the formatting and presentation of code, verse, and other preformatted text that should be presented exactly as written.
- Code: the code block displays its contents styled to indicate that the text is a short fragment of computer code.
- Verse: the verse block displays content as typed, preserving white space and line breaks, and is best suited to poetry and verse.
- Preformatted: the preformatted block displays text exactly as written and in a minimally formatted style.
Code
The Code block styles blocks of computer code. It has no options.
body {
background-color: $section-background-color;
color: $text-color;
font-family: $sans-serif-fonts;
font-size: 16px;
font-weight: 400;
line-height: 1.4;
}
Verse
The Verse block is designed to display freeform verse content where whitespace and line breaks should be preserved. You can style text inside of a verse block using the standard rich text options (bold, italic, links, etc.) in the block toolbar, where you can also adjust the alignment.
The Crocodile
Lewis Carroll
How doth the little crocodile
Improve his shining tail,
And pour the waters of the Nile
On every golden scale!
How cheerfully he seems to grin,
How neatly spreads his claws,
And welcomes little fishes in,
With gently smiling jaws!
Preformatted
The Preformatted block is for preserving whitespace as typed, such as in ASCII art.
Generic preformatted text will preserve all
whitespace even when there's a lot of it
and line breaks
and is minimally formatted.
Source
These are WordPress-created core blocks that are built in to WordPress.