<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Omar Rahman on Medium]]></title>
        <description><![CDATA[Stories by Omar Rahman on Medium]]></description>
        <link>https://medium.com/@omarrahman?source=rss-4ae940ba892c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Lz3Vj6a1rYntCvvP.jpg</url>
            <title>Stories by Omar Rahman on Medium</title>
            <link>https://medium.com/@omarrahman?source=rss-4ae940ba892c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 23:36:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@omarrahman/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Making 3D CSS flip cards]]></title>
            <link>https://medium.com/@omarrahman/making-3d-css-flip-cards-7b023c379778?source=rss-4ae940ba892c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b023c379778</guid>
            <dc:creator><![CDATA[Omar Rahman]]></dc:creator>
            <pubDate>Mon, 26 Jan 2015 03:35:52 GMT</pubDate>
            <atom:updated>2015-01-26T03:35:52.056Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*VyY-gC5qgUAdXF_T0PXJyA.gif" /></figure><h3>the Objective</h3><p>To make a div that flips on hover without using javascript</p><h3>Languages</h3><p>HTML</p><p>CSS</p><h3>the HTML</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DNoYRnx_59zVxvcLW5SiUw.png" /></figure><p><em>&lt;div class=”flip-container” ontouchstart=”this.classList.toggle(‘hover’);”&gt;</em></p><p>First, place the outer container. This container will house the content to be flipped. Use <em>ontouchstart=”this.classList.toggle(‘hover’);”&gt; </em>to enable the hover state for this div on touch devices.</p><p><em>&lt;div class=”flipper”&gt;&lt;/div&gt;</em></p><p>Next you will need to place the panel that will flip. This div will contain the front and back of the flipping content.</p><p><em>&lt;div class=”front”&gt;front content&lt;/div&gt;</em></p><p>Put any content you want in the front. This is the content that will show first</p><p><em>&lt;div class=”back”&gt;backcontent&lt;/div&gt;</em></p><h3>the CSS</h3><p><strong>Set perspective<br></strong><em>.flip-container { perspective: 350px;<br>}</em></p><p>This is the outer container that house the content to be flipped. The perspective will determine the perspective appearance of the flipped content during its flip.</p><p><strong><em>Set to flip on hover, set amount of spin</em></strong><em> .flip-container:hover .flipper, .flip-container.hover .flipper { transform: rotateY(200deg); }</em></p><p>This CSS tells the browser to flip the content along the Y axis by 200 degrees. See above how the flip card looks skewed when its flipped? That’s because of the combination of persepctive and rotateY values.</p><p><strong>Set sizes<br></strong><em>.flip-container, .front, .back { width: 300px; height: 300px;<br>}</em></p><p>This is the size I used for my flipping divs. You can change it to suit your purposes.</p><p><strong>Set speed and 3d style</strong><br><em>.flipper { transition: 0.6s; transform-style: preserve-3d; position: relative;<br>}</em></p><p>The transition element sets the transition time for the animation. Transform-style: preserve 3d makes the browser preserve the nesting of the elements in 3d space. This way they move together.</p><p><strong>Hide backface initially</strong><br><em>.front, .back { backface-visibility: hidden; padding: 10px; position: absolute; top: 0; left: 0;<br>}</em></p><p>This hides the back face initially.</p><p><strong>Keep front above back initially</strong><em><br>.front { z-index: 2; transform: rotateY(0deg);<br>}</em></p><p>This ensures that the front face is above the back.</p><p><strong><em>Sets the back to be initially reversed.</em></strong><em><br>.back { transform: rotateY(180deg);<br>}</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b023c379778" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>