Sunday, July 21, 2013

Pure CSS3 Ribbon Menu

This uses CSS3 transitions and CSS2 pseudo-elements to create an animated navigation ribbon with minimal markup.

Browser Support

IE8 and IE9 do not support CSS3 transitions, so the hover state will not be animated for those browsers. Otherwise it looks and functions the same, which I think is a very acceptable fallback. IE7 lacks support the :before and :after pseudo-elements, so the ribbon will not have the forked ends or display folds while hovering. The pseudo-elements could be replaced with actual markup IE7 support is needed.


The forked ends and folds are created with CSS pseudo-elements, allowing for very clean HTML.


Forked ends
.ribbon:after, .ribbon:before {
    content: "";
    border:1.5em solid #fff;
.ribbon:after {
.ribbon:before {

Here the :before and :after pseudo-elements are used to create empty elements with a thick border. The border has one edge set to transparent. This leaves the element looking like it had a triangular section removed, creating the forked look

Read more:

No comments :

Post a Comment