Skip to content

Instantly share code, notes, and snippets.

@matthiaswenz
Created April 24, 2012 08:54
Show Gist options
  • Save matthiaswenz/2478040 to your computer and use it in GitHub Desktop.
Save matthiaswenz/2478040 to your computer and use it in GitHub Desktop.
/*
Calculation to center diagonal separator:
new width of the :before-element after the rotation (Pythagoras) = 25.46px
add space to the right to visual center diagonal line: 25,46px / 2 = 12.73px
total amount for A: 25.46px + 12.73px = 38.19px
revise position of B: ( 25.46px - 18px ) / 2 = 3.73px;
change gap by adding half amount to B (+9px) than to A (+18px)
slightly change for visual perfection
*/
.controls li, #main-nav li:first-child {
padding: 0 0 0 56.19px; /* A */
}
.controls li:before, #main-nav li:first-child::before {
position: absolute;
display: inline-block;
content: "";
border-bottom: 1px solid #ddd;
width: 18px;
height: 18px;
left: 12.73px; /* B */
bottom: 9px;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment