Skip to content

Instantly share code, notes, and snippets.

View trafnar's full-sized avatar

Nathan Manousos trafnar

View GitHub Profile
@trafnar
trafnar / gist:998497
Created May 30, 2011 05:43
How to style input button to look like a link
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>index</title>
<style type="text/css" media="screen">
input[type=submit]{border:none; background-color:transparent; font-family:helvetica, arial, sans-serif; color:#0000ff; text-decoration:underline;}
</style>
</head>
class Person < ActiveRecord::Base
has_many :pets # pets table has a person_id
has_one :favorite_pet, :class_name => 'Pet' # persons table has favorite_pet_id
end
class Pet < ActiveRecord::Base
belongs_to :person # using person_id
end
<!DOCTYPE html>
<html>
<head>
<title>index</title>
<style type="text/css" media="screen">
form{border:1px solid #aaa; padding:20px;}
form input.text{display:block; border:1px solid red;}
form label{display:block;}
body.department.article #mix_square_container ul li div.location1{color:#fff; position:absolute; left:0; bottom:10px; width:100%; text-align:center; font-family:'HelveticaNeueLTStd75Bold'; font-size:14px;}
body.department.article #mix_square_container ul li div.location2{color:#000;position:absolute; left:0; bottom:10px; width:100%; text-align:center; font-family:'HelveticaNeueLTStd75Bold'; font-size:14px;}
body.department.article #mix_square_container ul li div.location{color:#fff; position:absolute; left:0; bottom:10px; width:100%; text-align:center; font-family:'HelveticaNeueLTStd75Bold'; font-size:14px;}
body.department.article #mix_square_container ul li.light .location{color:#000;}
<link rel="stylesheet" href="http://gist.github.com/raw/609334/1ff93b78a0415f93a9faf8c8f5ed228fbe53df70/selectors.css" type="text/css">
<script type="text/javascript" charset="utf-8" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="http://gist.github.com/raw/609333/b68041fd00b956cc7c89b9b742d6bef9205ac058/selectors.js"></script>
.selected{background-color:yellow; opacity:.8;}
@trafnar
trafnar / selectors.js
Created October 4, 2010 07:03
test selectors
$(function(){
$('#selector').keyup(function(){
$('.selected').removeClass('selected');
var selector = $(this).attr('value');
$(selector).addClass('selected');
});
});
#fdbk_tab,
#zenbox_tab,
#uservoice-feedback-tab{display:none !important;}
#facebook #pagelet_pymkbox,
#facebook #pagelet_adbox,
#facebook #pagelet_connectbox,
#facebook #pagelet_chat_home,
#facebook #bookmarks_menu #uiSideNav{display:none;}
@trafnar
trafnar / gist:367966
Created April 16, 2010 03:21
Examples of common CSS properties and techniques
<style type="text/css" media="screen">
*{margin:0; padding:0;}
h1,h2{margin-bottom:10px; margin-top:30px;}
body{padding:30px;}
</style>
<h1>floats</h1>
<h2>simple left/right</h2>
<style type="text/css" media="screen">
#simple_floats{overflow:auto; border:5px solid #092994; width:500px;}