Created
December 24, 2012 01:15
-
-
Save dangvanthanh/4367003 to your computer and use it in GitHub Desktop.
CSS Event Click
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * CSS Event Click | |
| */ | |
| body { color: #444;} | |
| a { color: #444; text-decoration: none; } | |
| h1 { color: #222; font-size: 1.5em; text-transform: uppercase; } | |
| input[type="checkbox"]:checked ~ .changed-one { | |
| color: #f00; | |
| } | |
| .changed-two:target { | |
| color: rgba(255, 0, 0, .7); | |
| } | |
| .focus:focus ~ .changed-three { | |
| color: rgba(255, 0, 0, .5); | |
| } | |
| .transition:active ~ .changed-four { | |
| transition: all 0s; | |
| color: rgba(255, 0, 0, .3); | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- content to be placed inside <body>…</body> --> | |
| <div class="box"> | |
| <h1>Checkbox Hack</h1> | |
| <input type="checkbox"> | |
| <p class="changed-one">I'm going to be red! Wait for it...</p> | |
| </div> | |
| <div class="box"> | |
| <h1>The :Target Way</h1> | |
| <a href="#id">Click Me!</a> | |
| <p id="id" class="changed-two">I'm going to be red! Wait for it...</p> | |
| </div> | |
| <div class="box"> | |
| <h1>The :Focus Way</h1> | |
| <span tabindex="0" class="focus">Click Me!</span> | |
| <p class="changed-three">I'm going to be red! Wait for it...</p> | |
| </div> | |
| <div class="box"> | |
| <h1>Transition Hack</h1> | |
| <span class="transition">Click Me!</span> | |
| <p class="changed-four">I'm going to be red! Wait for it...</p> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // alert('Hello world!'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment