A Pen by Chris Coyier on CodePen.
Created
November 8, 2014 14:34
-
-
Save anonymous/70afd844c5be83800c5a to your computer and use it in GitHub Desktop.
A Pen by Chris Coyier.
This file contains 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
<h3><img> with #fragment referencing <view></h3> | |
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-1.svg#icon-clock-view" alt="" /> | |
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-1.svg#icon-heart-view" alt="" /> | |
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-1.svg#icon-arrow-right-view" alt="" /> | |
<br><br> | |
<h3><img> with #svgView(viewBox())</h3> | |
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-2.svg#svgView(viewBox(0,0,32,32))" alt="" /> | |
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-2.svg#svgView(viewBox(0,32,32,32))" alt="" /> | |
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-2.svg#svgView(viewBox(0,64,32,32))" alt="" /> | |
<br><br> | |
<h3>background-image with #fragment referencing <view></h3> | |
<span class="icon icon-clock"></span> | |
<span class="icon icon-heart"></span> | |
<span class="icon icon-arrow-right"></span> | |
<br><br> | |
<h3>background-image with #svgView(viewBox())</h3> | |
<span class="icon icon-clock-2"></span> | |
<span class="icon icon-heart-2"></span> | |
<span class="icon icon-arrow-right-2"></span> | |
<br><br> | |
<h3>background-image with background-position</h3> | |
<span class="icon icon-clock-3"></span> | |
<span class="icon icon-heart-3"></span> | |
<span class="icon icon-arrow-right-3"></span> | |
<br><br> | |
<h3><img> with hide/show embedded :target CSS</h3> | |
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-3.svg#icon-clock" alt="" /> | |
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-3.svg#icon-heart" alt="" /> | |
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-3.svg#icon-arrow-right" alt="" /> |
This file contains 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
body { | |
padding: 20px; | |
} | |
img { | |
width: 32px; | |
height: 32px; | |
} | |
.icon { | |
display: inline-block; | |
width: 32px; | |
height: 32px; | |
} | |
.icon-clock { | |
background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-1.svg#icon-clock-view) no-repeat; | |
} | |
.icon-heart { | |
background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-1.svg#icon-heart-view) no-repeat; | |
} | |
.icon-arrow-right { | |
background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-1.svg#icon-arrow-right-view) no-repeat; | |
} | |
.icon-clock-2 { | |
background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-2.svg#svgView(viewBox(0,0,32,32))") no-repeat; | |
} | |
.icon-heart-2 { | |
background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-2.svg#svgView(viewBox(0,32,32,32))") no-repeat; | |
} | |
.icon-arrow-right-2 { | |
background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-2.svg#svgView(viewBox(0,64,32,32))") no-repeat; | |
} | |
.icon-clock-3 { | |
background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-1.svg") no-repeat; | |
background-size: 32px 96px; | |
background-position: 0 0; | |
} | |
.icon-heart-3 { | |
background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-2.svg") no-repeat; | |
background-size: 32px 96px; | |
background-position: 0 -32px; | |
} | |
.icon-arrow-right-3 { | |
background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/fragment-ready-2.svg") no-repeat; | |
background-size: 32px 96px; | |
background-position: 0 -64px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment