Skip to content

Instantly share code, notes, and snippets.

@brianbroken
brianbroken / hello-world.js
Last active December 17, 2015 03:38
jQuery: Hello world
$(document).ready(function () {
alert("Hello world!");
});
@brianbroken
brianbroken / truncate.css
Last active December 16, 2015 17:38
CSS: Truncate String with Elilipsis
.truncate {
width: 250px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
@brianbroken
brianbroken / mixins.css
Last active December 16, 2015 17:38
CSS: Useful mixins
.text-shadow (@string: 0 1px 3px rgba(0, 0, 0, 0.25)) {
text-shadow: @string;
}
.box-shadow (@string) {
-webkit-box-shadow: @string;
-moz-box-shadow: @string;
box-shadow: @string;
}
.drop-shadow (@x: 0, @y: 1px, @blur: 2px, @spread: 0, @alpha: 0.25) {
-webkit-box-shadow: @x @y @blur @spread rgba(0, 0, 0, @alpha);
@brianbroken
brianbroken / Transparent Background images.css
Last active April 5, 2019 09:18
CSS: Transparent Background images
div {
width: 200px;
height: 200px;
display: block;
position: relative;
}
div:after {
content: "";
background: url(http://subtlepatterns.com/patterns/bo_play_pattern.png);
@brianbroken
brianbroken / gist:5471342
Last active December 16, 2015 17:38
CSS: Slide in image boxes
/* http://css-tricks.com/examples/SlideInImageBoxes/ */
footer {
clear:both;
overflow:hidden;
font-size:16px;
line-height:1.3;
}
#footer-boxes {
@brianbroken
brianbroken / gist:5471337
Created April 27, 2013 00:23
CSS: Ribbon
<h1 class="ribbon">
<strong class="ribbon-content">Everybody loves ribbons</strong>
</h1>
.ribbon {
font-size: 16px !important;
/* This ribbon is based on a 16px font side and a 24px vertical rhythm. I've used em's to position each element for scalability. If you want to use a different font size you may have to play with the position of the ribbon elements */
width: 50%;
@brianbroken
brianbroken / gist:5471334
Created April 27, 2013 00:22
CSS: Rounded corners
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px; /* future proofing */
-khtml-border-radius: 10px; /* for old Konqueror browsers */
@brianbroken
brianbroken / gist:5471333
Created April 27, 2013 00:21
CSS: page curl shadows
ul.box {
position: relative;
z-index: 1; /* prevent shadows falling behind containers with backgrounds */
overflow: hidden;
list-style: none;
margin: 0;
padding: 0; }
ul.box li {
position: relative;
@brianbroken
brianbroken / gist:5471325
Last active December 16, 2015 17:30
CSS: Meyer reset
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
@brianbroken
brianbroken / gist:5471324
Last active December 16, 2015 17:30
CSS: Link Pseudo-Classes (In Order)
a:link {color: blue;}
a:visited {color: purple;}
a:hover {color: red;}
a:active {color: yellow;}