Code block allows you to add formatted code for others to view.
To add a code, click on the
⊕ Block Inserter icon and select the “Code” block.
Alternatively, you can start typing
/code in a new paragraph block, then press enter.
Once you insert a code block, you can add or edit your code in the editor. Also, you will have all the standard block options as well.
Optionally, you can transform the code block into a preformatted block.
Although most blocks come with unique and block-specific controls, the code block is pretty straightforward, and only has the “More Options” control available to config.
Clicking on the ⚙ cog icon next to the publish button will toggle the visibility of this panel.
While most blocks have specific options in the editor sidebar in addition to the options found in the block toolbar, the code block does not have extra options to alter.
The advanced tab lets you add a CSS class to your block, allowing you to write custom CSS and apply styles to the block as you see fit.
Last updated: 1 year ago