Archived topic
content boxes
3 replies · Started by Micol on January 13, 2019
Hi, I need to create content boxes containing codes like in this example
https://elfi.readthedocs.io/en/latest/developer/contributing.html
How can I achieve this with GP (I am a wordpress beginner)?
Thanks a lot for any help
Sam
Hi there,
if you're using Gutenberg you can use the Code Block.
if you're in the classic editor - you can wrap your code like this:
<pre><code>
My code in here
</code></pre>
So best thing is to add your code to Visual (normal) editor, then swap to the Text (code) editor and put in the <pre><code> tags.
Hi David! Thanks a lot, it worked!
Can you tell me how to change the color of the box? Now it's grey.
Thanks again and have a nice day
Try this:
code {
background-color: #d0d0d0; /* change hex value */
}