Articles by

Chris Coyier

Founder, writer, designer, spam-deleter, email personality

Loading Dots jQuery Plugin

Loading.... It's a design pattern we've all seen before, because it's just good user feedback. This is a quick jQuery plugin to apply it to any element when called (exactly in the middle of it).
Avatar of Chris Coyier
Chris Coyier on (Updated on )

#84: Site Walkthrough of chris-mcgarry.com

I built a site for a musician friend of mine who is putting out a new album. Clearly having playable tracks is important, but the classic issue of having those tracks stop when a new page is loaded comes up …

Avatar of Chris Coyier
Chris Coyier on (Updated on )

Child and Sibling Selectors

Do you know what the difference between these selectors are?

ul li { margin: 0 0 5px 0; }
ul li { margin: 0 0 5px 0; }

I’ll admit it took me longer than it probably should have (way …

Avatar of Chris Coyier
Chris Coyier on (Updated on )

jQuery Plugin Template

Replace instances of “yourPluginName” with your actual plugin name. The stuff about “radius” is just an example of an option (parameter to pass plugin).

(function($){
    $.yourPluginName = function(el, radius, options){
        // To avoid scope issues, use 'base' instead of 'this'
        
Avatar of Chris Coyier
Chris Coyier on

jQuery CSS Abstraction

It should be said, first and foremost, that you should try to keep your styling and your JavaScript away from each other. If you want to change the style of an element with JavaScript, add (or remove) a class name …

Avatar of Chris Coyier
Chris Coyier on (Updated on )

Reset Admin Password in Database

Forget your admin password and don’t have access to the email account it’s under? If you can get access to phpMyAdmin (or anything you can run mySQL commands), you can update it there.

UPDATE `wp_users` SET `user_pass` = MD5( 'new_password_here' 
Avatar of Chris Coyier
Chris Coyier on

CSS Secret Message Generator

I know ya’ll were just thinking to yourselves: man, I hope Chris posts some super nerdy article today with some nearly-useless technique that if I talked about in public would clinch the fact that I’m not getting laid anytime soon. …

Avatar of Chris Coyier
Chris Coyier on

Force Correct content-type for XHTML Documents

Most webservers serve XHTML content as text/html what is definitly the right way to handle XHTML documents. In case the server isn’t doing that correctly, you can force it on Apache servers with .htaccess:

RewriteEngine On
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml
RewriteCond 
Avatar of Chris Coyier
Chris Coyier on

iPad Orientation CSS

<link rel="stylesheet" media="all and (orientation:portrait)" href="portrait.css">
<link rel="stylesheet" media="all and (orientation:landscape)" href="landscape.css"> 
Avatar of Chris Coyier
Chris Coyier on