Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Add ribbon to a container

  • Hi!

    I would like to add a ribbon with text on my comparison site. I would like ribbons on the containers with numbers and text like “Best choice” and “No1” etc.
    I cant figure out how to get it to work though.
    I copy the css for the ribbon from: https://css-generators.com/ribbon-shapes/. Paste it to Additional CSS and then give the container the CSS class. But it feels like I am missing something here…

    Best

    -Johan

  • Hi Johan,

    Can you add cu-best-ribbon to the Container Block to which you want to add the ribbon? I’ll try to see what CSS code is needed to make such a ribbon or a similar ribbon appear.

    Adding Custom Classes: https://wordpress.com/support/wordpress-editor/adding-additional-css-classes-to-blocks/

  • Sure! Is added.
    -Johan

  • One last thing, from this link you provided: https://css-generators.com/ribbon-shapes/ – which specific ribbon are you going for?

  • #8 please!

  • Here’s a sample code you can try adding through Appearance > Customize > Additional CSS:

    .gb-container.cu-best-ribbon{
        position: relative;
    }
    .gb-container.cu-best-ribbon::after {
        content: "Best Choice!";
        position: absolute;
        display: flex;
        justify-content: center;
        align-items:center;
        text-align:center;
        font-weight: 900;
        width: 80px;
        top:-12px;
        left: 30px;
        height: 100px;
        clip-path: polygon(0 0, 100% 0, 100% 79%, 50% 100%, 0 79%);
        background: #f9ca01;
    }
    
    .gb-container.cu-best-ribbon::before{
        content: "";
        position: absolute;
        display: flex;
        justify-content: center;
        align-items:center;
        text-align:center;
        font-weight: 900;
        width: 12px;
        top:-12px;
        left: 19px;
        height: 12px;
        clip-path: polygon(100% 0, 0% 100%, 100% 100%);
        background: #b39309;
    } 
  • Thanks. I added it, and it appears… But on the top of the page not the container.
    Weird?

    -Johan

  • There’s an extra } above the new code causing a syntax error. Can you remove that?

    You can copy and paste your CSS codes here to check for any syntax errors: http://csslint.net/

  • Sorry bout that. Works like a charm now! Thanks!

  • You’re welcome, Johan!

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.