Skip to content

Instantly share code, notes, and snippets.

@chrisslater
Last active December 16, 2015 14:48
Show Gist options
  • Save chrisslater/5450847 to your computer and use it in GitHub Desktop.
Save chrisslater/5450847 to your computer and use it in GitHub Desktop.
Strikethrough responsive header SCSS and HTML markup
<div class="container">
<h1>Example Header</h1>
</div>
@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