Skip to content

Instantly share code, notes, and snippets.

View rodi01's full-sized avatar

Rodrigo Soares rodi01

View GitHub Profile
@rodi01
rodi01 / css
Created February 1, 2012 06:51
Create Date Badge with Wordpress and CSS
body { font-size: 62.5%; }
.post {
position: relative;
margin-left: 4.8em;
}
.entryDate {
border: 1px solid #999;
font-family: Georgia,"Times New Roman", serif;
left: -4.8em;
line-height: 1;
@rodi01
rodi01 / css
Created February 1, 2012 06:39
Adjacent Sibling Selector Bug in IE7
p + p { background-color: #fc0; }
@rodi01
rodi01 / jquery
Created February 1, 2012 06:33
Animated Page Scroll with jQuery
$('.scrollPage').click(function() {
var elementClicked = $(this).attr("href");
var destination = $(elementClicked).offset().top;
$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination-20}, 500 );
return false;
});
@rodi01
rodi01 / css
Created February 1, 2012 06:28
The Right Way to Declare RGBa Colors
/* NON RGBa BROWSERS
------------------------------------------------------ */
#wrap { background-color: #000; }
#footer,
#header { background-color: #ccc; }
.section { color: #fff; }
/* HEADER
------------------------------------------------------ */
#header { background-color: rgba(204,204,204,.8); }
@rodi01
rodi01 / css
Created February 1, 2012 06:00
Renaming and Extending Easy-Clearing, AKA Clearfix
.group:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
@rodi01
rodi01 / css
Created February 1, 2012 05:45
Adding hasJS Class When JavaScript Is Available
.hasJS .module {
display: none;
}
@rodi01
rodi01 / css
Created January 31, 2012 09:33
CSS Tooltip
.tooltip { position: relative; }
.tooltip span {
position: absolute;
right: 0;
top: -35px;
display: none;
min-width: 50px;
padding: 3px 8px;
white-space: nowrap;
font-size: 11px;
@rodi01
rodi01 / css
Created January 31, 2012 09:27
Nice input labels using jQuery and CSS
form li { position: relative; }
label {
position: absolute;
top: 5px; // adjust as needed
left: 5px;
}
//remove absolute position if the label comes after
//the input. Eg. a checkbox with a text next to it
input + label { position: static; }
@rodi01
rodi01 / horizontal
Created September 10, 2011 04:48
Resize Textarea in Webkit
textarea {
resize: horizontal;
}