Skip to content

Instantly share code, notes, and snippets.

@electriccode
Last active December 15, 2015 18:59
Show Gist options
  • Save electriccode/5308482 to your computer and use it in GitHub Desktop.
Save electriccode/5308482 to your computer and use it in GitHub Desktop.
Custom CSS library
// Truncate a text. Override width to truncate to a specific width.
.trunc {
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
display:block;
width:100%;
}
// center align divs
.container {
margin:0 auto;
}
// Cross browser button code
.button {
position:relative;
overflow:hidden;
}
.button input {
position:absolute;
top:50%;
left:50%;
margin-top:-25em;
margin-left:-50em;
width:100em;
height:50em;
display:block;
-webkit-appearance:button;
cursor:pointer;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
/* IE 5-7 */
filter: alpha(opacity=0);
/* Netscape */
-moz-opacity: 0;
/* Safari 1.x */
-khtml-opacity: 0;
/* Good browsers */
opacity: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment