$('ul li:first-child').click(function() { $(this).siblings().toggle(); });
Remove indenting on UL and OL tags
ol { margin: 0; padding: 0; list-style-position: inside; } By default, most browsers indent list elements from the left margin. The magic above is the…
Eliminate page centering “jumps”
body { overflow-y: scroll; } How annoying is it when you link from a "short" page to a "long" page and the vertical scrollbar "jumps"…
Use jQuery to highlight the current navigation item
$('a').each(function() { if(document.URL.indexOf($(this).attr('href')) >= 0) $(this).addClass('selected'); }); Note: This code will add the 'selected' css class to all <a> tags which link to…
Registered (®) and Trade (™) marks / superscript line spacing
sup { position: relative; height: 0; bottom: 1ex; line-height: 1em; vertical-align: baseline; _vertical-align: bottom; /* ie6 hack */ } If you want to adjust…