Skip to main content

Posts

Showing posts from September, 2012

Fanning Cards with CSS

I was thinking of fanning out some cards to demonstrate options for one of our sites, and I wanted to do it in CSS, so I came up with this (Plan for fall-back in non-supporting browsers is just a button that shows the options). The plan is to show all options in full when the stack is clicked on, but right now it just fans out on hover. This isn't anything terribly ground-breaking or difficult, but it is a nice, fun effect so I thought I'd share. Edit: I updated the link and code here to point to an updated version of the code that uses the css3 :target selector to spread out the cards when a link is clicked, and collapse them when it's closed. (See the full page example for better effect) See the Pen Fanning Cards by Thomas Pietrosanti ( @Rykus0 ) on CodePen . I used SASS to do handle some of the incremental and procedural parts, but did not leverage Compass, since I am not using it. Really, all I'm doing is absolutely positioning div s on top of ea