Reputation: 5009
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?
Upvotes: 1
Views: 743
Reputation: 72261
You can only have one :before
and :after
pseudo 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.
Upvotes: 3