Rotating Images/Divs
I'm currently rebuilding my portfolio and as part of that I'm pulling in 3 images from Instagram, it then positions the UL relative and all the LI's absolute so the sit on top of each other.
To get a stacked image effect I rotate each of those images separability using :nth-child()
.instagram li:nth-child(1) {
-webkit-transform: rotate(20deg);
-moz-transform: rotate(20deg)
-ms-transform: rotate(20deg);
-o-transform: rotate(20deg)
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
The problem is the support for :nth-child() in Firefox 3. If this in a problem simply use a unique class instead on to these 3 list items and use that instead of nth-child.
Here is the result
This is my first coderwall post, hope you enjoy the tip.
Written by Grant
Related protips
5 Responses
Psst, it should be -webkit-transform: rotate(20deg); not webkit-transform: rotate(20deg);
@rachelnabors Oops, thank you very kindly :)
Nice one :)
I could be wrong, but :nth-child() also does not appear to be supported in IE <= 8, so filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); might not matter here, unless you also want to use the same fix for FF3.
Didn't think of "stacking" images like CDs, thanks for the tip and the inspiration.