Skip to content

Instantly share code, notes, and snippets.

@gemmadlou
Last active September 5, 2016 17:11
Show Gist options
  • Save gemmadlou/a8e46681824fe8c95bf11b8726e51713 to your computer and use it in GitHub Desktop.
Save gemmadlou/a8e46681824fe8c95bf11b8726e51713 to your computer and use it in GitHub Desktop.
Inline Text Background Solution
.c-slab-text {
padding: 0.3em 0;
position: relative;
padding-left: 20px;
overflow: hidden;
&:before {
content: ' ';
position: absolute;
top: -2px;
left: 0;
bottom: 0;
background-color: black;
width: 20px;
display: block;
}
&__inner {
display: inline;
background-color: black;
padding: 0.6em 0;
padding-right: 10px;
}
&__inner__element {
position: relative;
color: white;
left: -10px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment