I’m following a tutorial on how to make a CSS ribbon. However the end result only shows a ribbon on one side of a given element. I’m wondering: given the code in the tutorial, is there a way to get it to appear on both sides? Maybe I’m confused by the meaning of :before and :after. Do I need to add a <div> on either side and target both?
I’m following a tutorial on how to make a CSS ribbon. However the end
Share
You can only have one
:beforeand:afterpseudo element per element, so you need to add another wrapper and style that one with opposing characteristics. I’ve put one together for you here, based on the tutorial you referenced.To understand better pseudo elements, viewing a previous answer of mine might be helpful.