Skip to content

Instantly share code, notes, and snippets.

View jonathansousa's full-sized avatar

Jonathan D. Sousa jonathansousa

  • Zuno, Inc.
  • Washington, DC
  • 10:58 (UTC -04:00)
View GitHub Profile
@jonathansousa
jonathansousa / gist:2049962
Created March 16, 2012 12:52
CSS: word-wrapping, hyphenation
-ms-word-break: break-all;
word-break: break-all;
// Non standard for webkit
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
@jonathansousa
jonathansousa / gist:2049981
Created March 16, 2012 12:58
CSS: Image Replacement Technique
.ir {
font: 0/0 a;
text-shadow: none;
color: transparent;
}
@jonathansousa
jonathansousa / gist:2050011
Created March 16, 2012 13:09
CSS: Skip Link
.hide-text {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
@jonathansousa
jonathansousa / HTML HTML5 Template
Created April 19, 2012 21:55
HTML: HTML5 Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<!-- Metadata -->
<meta name="viewport" content="width=device-width">
<meta property="og:image" content="images/logo.png">
<meta property="og:title" content="">
<meta property="og:url" content="">
@jonathansousa
jonathansousa / gist:2424845
Created April 19, 2012 23:30
CSS: Triangle Examples
.arrow-up {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-bottom: 5px solid black;
}
.arrow-down {
width: 0;
@jonathansousa
jonathansousa / CSS Hide n in List but not Last
Created May 4, 2012 23:26
CSS: Hide n in List but not Last
&.last {
display:none;
}
&:nth-child(n+6) { /* Set the number to the number of menu items to show including "more" */
display:none;
&:nth-last-child(-n+1) {
display:block;
}
}
&.last:nth-child(6) { /* Make sure this number matches the menu items above to hide the more item at the right time */
@jonathansousa
jonathansousa / dabblet.css
Created May 7, 2012 22:32
Dabblet: List Single Item Positioning Experiment
/**
* List Single Item Positioning Experiment
* The first commented line is your dabblet’s title
*/
ul {
position:relative;
}
ul:hover > li {
float:left;
}
@jonathansousa
jonathansousa / dabblet.css
Created May 9, 2012 00:21
Dabblet: Display pseudo element for hidden element
/**
* Display pseudo element for hidden element
* The first commented line is your dabblet’s title
*/
.hideme {
height:0;
overflow:hidden;
display:relative;
}
.hideme:after {
@jonathansousa
jonathansousa / HTML Character Codes
Created June 27, 2012 00:10
HTML: Character Codes
Name Character Entity
Copyright © &copy;
Registered ® &reg;
Trademark ™ &trade;
Curly Open Double Quote “ &ldquo;
Curly Closed Double Quote ” &rdquo;
Curly Open Single Quote ‘ &lsquo;
Curly Closed Single Quote ’ &rsquo;
Big Bullet/Dot • &bull;
/* Empty Elements */
div:empty, span:empty, li:empty, p:empty, td:empty, th:empty
{ padding: 20px; border: 5px dotted yellow !important; }
/* Empty Attributes */
*[alt=""], *[title=""], *[class=""], *[id=""], a[href=""], a[href="#"]
{ border: 5px solid yellow !important; }
/* Deprecated Elements */
applet, basefont, center, dir, font, isindex, menu, s, strike, u