Note that there are some explanatory texts on larger screens.

plurals
  1. POFade out when div appears from Transition :active Hack?
    primarykey
    data
    text
    <p>I was wondering if there was a simple way of making my menu fade out as I've already figured out how to make it fade in.</p> <p>Preferably CSS.</p> <p>I'm using the transition hack that uses :active to trigger the menu. Any suggestions on the code would be welcome too :)</p> <p>Jsfiddle: <a href="http://jsfiddle.net/VFykd/2/" rel="nofollow">http://jsfiddle.net/VFykd/2/</a></p> <p>HTML</p> <pre><code>&lt;label for=checkme class=menu-button&gt; &lt;div class="responsive-icon"&gt; Trigger &lt;/div&gt; &lt;/label&gt; &lt;input id=checkme type=checkbox hidden&gt; &lt;div class="menu"&gt; &lt;div class="container"&gt; &lt;ul&gt; &lt;li&gt; &lt;label for=checkme class=close-button&gt; &lt;strong&gt;X&lt;/strong&gt;&lt;/a&gt; &lt;/label&gt; &lt;input id=checkme type=checkbox hidden&gt;&lt;/label&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#home" &gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#about"&gt;About&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#skills"&gt;Skills&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#work"&gt;Portfolio&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#blog"&gt;Blog&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#contact"&gt;Contact&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>CSS</p> <pre><code>.menu { opacity:0; position:fixed; } .close-button { position:absolute; right:20px; } .menu strong { color:#258ace; font-size:20px; } .menu a { color:#999; font-weight:300; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; -o-transition: all 1s ease; -ms-transition: all 1s ease; transition: all 1s ease; } .menu a:hover { color:#258ace; font-weight:300; text-decoration:none; } input:checked ~ .menu { opacity:1; display:inline-block; position:fixed; bottom:0; left:0; background:#222; padding:20px 0 20px 0; margin:0 auto; width:100%; z-index:999; text-transform:uppercase; text-align:center; font-size:20px; -webkit-transition: opacity 0.5s ease-in; -moz-transition: opacity 0.5s ease-in; -o-transition: opacity 0.5s ease-in; -ms-transition: opacity 0.5s ease-in; transition: opacity 0.5s ease-in; } input:checked ~ .menu a { opacity:1; display:inline-block; } .menu-button { position:fixed; top:20px; z-index:999; width:100%; text-align:center; } .menu ul { list-style:none; display:inline; margin:0; } .menu li { list-style:none; display:inline; margin:0; margin: 0 5px 0 5px; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload