[Support request] Formatting code text

Home Forums Support [Support request] Formatting code text

Home Forums Support Formatting code text

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1615384
    Maynard

    Hi,

    Newbie question. I noticed on this forum that code is published in a nice box and in red — here is my code.

    How can I achieve this within GeneratePress? When I use < code >, the text is monotype without the box.

    Would be useful to know how all < code > text on a website can be changed to show the code in this better format.

    Any help appreciated.

    #1615443
    David
    Staff
    Customer Support

    Hi there,

    the Code Block should show you a similar style to what is displayed here.
    If it isn’t can you share a link to a page where i can see the issue.

    #1618381
    Maynard

    Hi
    Ok, link in the private info box. Two examples very near the top. Just a skeleton WP site with GeneratePress/Blocks installed. Thanks for helping.

    #1618587
    David
    Staff
    Customer Support

    Its working as it should in the Code Block.
    For the HTML Block you also need to include the <pre></pre> tags which is where the padding and background colors are applied eg.

    <pre><code> in custom html block</code></pre>

    #1618624
    Maynard

    Hi,
    Sorry, now tried with pre tags for the HTML block and not really getting anywhere 🙁

    In this forum I see the code tag gives nice red text in a box with a thin border like this.

    But on my site I see monotype black text with a grey background. Is this black monotype text what I am expected to see?

    #1618648
    David
    Staff
    Customer Support

    That will require some CSS:

    pre {
      border-radius: 4px;
      border: 1px solid #ccc;
      color: #f00;
    }
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.