Skip to content

Instantly share code, notes, and snippets.

@tyom
Created December 15, 2020 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyom/9a5dfc38bcb07b23ce34e06527eaae38 to your computer and use it in GitHub Desktop.
Save tyom/9a5dfc38bcb07b23ce34e06527eaae38 to your computer and use it in GitHub Desktop.
Dividing lines for centred text (CSS)
.divider {
margin: 1.5rem 0;
position: relative;
overflow: hidden;
&::before,
&::after {
content: '';
position: absolute;
top: 50%;
border-top: 1px solid #ccc;
margin: 0 1rem;
width: 100%;
}
&::before {
margin-left: calc(-1 * 100% - 1rem);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment