-
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
-
Fernando
Hi Johan,
Can you add
cu-best-ribbonto 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 -
Fernando
One last thing, from this link you provided: https://css-generators.com/ribbon-shapes/ – which specific ribbon are you going for?
-
#8 please!
-
Fernando
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
-
Fernando
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!
-
Fernando
You’re welcome, Johan!
- You must be logged in to reply to this topic.