CSS play - Image Rotation

9th May 2011

For IE9, Firefox, Opera, Safari and Chrome





copyright © stu nicholls - CSS play

Information

Whilst browsing the web recently I came across this demonstration using javascript to cycle through a set of images to give the impression of rotation and thought it would be a challenge to produce something similar using just CSS and html. So here it is.

The code uses only one 'classname' and no 'ids', all the element handling is done using CSS selectors 'nth-of-type' and the general sibling selector. Though not as 'swish' as the javascript version it does give a reasonable rotation and amazingly works in IE9.

This also enabled me to get to grips with the 'nth of type' selector which can be a little confusing at first sight.

Tested and working in IE9, Firefox, Opera, Safari and Chrome.


Copyright

You may use this method on your personal 'non-profit' web site without seeking my permission. A link back to CSSplay is always appreciated.

Commercial usage is also permitted without seeking approval, but I would ask that a donation is considered to support my work on CSSPlay.

If you are having problems integrating any of my demonstrations into your website then I now offer a service to fault find and correct any errors that you may have introduced. Please email me for more information.



Please Support CSS play

Please note that if your donation is for a demo/menu then you will need to email me with the url of the demo/menu after making the donation

For more CSS demonstrations I recommend that you visit the Dynamic Drive CSS Library.


Free, practical CSS menus, layouts, and examples

Follow CSS play


Facebook   Twitter   Facebook Fan Page