Site logo

Archived topic

Code block Title

7 replies · Started by Jatin on October 13, 2022

Viewing posts 1–8 of 8

Hi Guys,

I have just visited a website which was using a Code block and prism.js for showing code block. The site is using Generatepress.

I have provided a sample blog post of the site where the code block is being used.

Code Block contains a Title. How to add a title to the code block.

When i checked it in the site's CSS its using something like below. How can i apply the same to my site please.

.prism-titlename {
    margin: -16px -16px 24px -16px;
    padding: 4px 16px;
    font-weight: bold;
    color: #333;
    background-color: #eee;
}

Hi Jatin,

Try adding class code-block-title to the class list of the Heading Block, then add this in Appearance > Customize > Additional CSS:

.code-block-title {
    margin-bottom: -10px;
    padding: 8px 16px;
    font-weight: bold;
    color: #333;
    background-color: #eee;
}

Added whats next ? How to add title ?
I am using Prism.js and same has been in use in the other site as well.

Aren't these the title for instance?: Powershell code to disable SSL 2.0

Can you try adding the class to those Heading Blocks if so?

No Thats just Headlines, Please check the site which I sent as an example. How that site is doing it ?

Thanks

You're welcome Jatin!

This archived topic is closed to new replies.