Last active
December 16, 2015 14:48
-
-
Save chrisslater/5450847 to your computer and use it in GitHub Desktop.
Strikethrough responsive header SCSS and HTML markup
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
<div class="container"> | |
<h1>Example Header</h1> | |
</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
@mixin strikethrough-header($line: 1px solid #000, $padding: 20px) { | |
& { | |
display:inline-block; | |
position:relative; | |
} | |
&:before, &:after { | |
border-top: #{$line}; | |
width: 10000px; | |
height:1px; | |
display:block; | |
content: " "; | |
position: absolute; | |
top: 50%; | |
} | |
&:before { | |
left: 100%; | |
margin-left: #{$padding}; | |
} | |
&:after { | |
right: 100%; | |
margin-right: #{$padding}; | |
} | |
text-align:center; | |
} | |
.container { | |
text-align:center; | |
position:relative; // Optional | |
overflow:hidden; // Optional | |
} | |
h1 { | |
@include strikethrough-header(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment