A Pen by Robert Messerle on CodePen.
Created
July 24, 2017 10:04
-
-
Save theWhiteFox/051adf3057d1fccb3f6d50708fadfd1a to your computer and use it in GitHub Desktop.
Slashed CSS Effect
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
.slashed | |
.top(title='Slashed') | |
.bot(title='Slashed') |
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
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> |
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
@import "nib" | |
html, body { | |
height: 100%; | |
overflow: hidden; | |
} | |
body { | |
transform: rotate(-5deg); | |
background: radial-gradient(center, crimson, darken(crimson, 60%)); | |
} | |
.slashed { | |
absolute: top 0 left 0 right 0 bottom 0; | |
text-shadow: 3px 3px 3px rgba(black, 0.5); | |
.top, .bot { | |
text-align: center; | |
font: 62px/100px arial; | |
text-transform: uppercase; | |
text-align: center; | |
overflow: hidden; | |
color: white; | |
&:before { | |
content: attr(title); | |
transform: rotate(5deg); | |
} | |
} | |
.top { | |
absolute: top 0 left 5px right 0 bottom 50%; | |
&:before { | |
absolute: bottom -50px left 0 right 0; | |
} | |
} | |
.bot { | |
absolute: top 50% left 0 right 5px bottom 0; | |
&:before { | |
absolute: top -50px left 0 right 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment