tvalent2
tvalent2

Reputation: 5009

How to get css3 ribbon on both sides of element

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

Answers (1)

ScottS
ScottS

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

Related Questions