Handy Tip for CSS Reloading

cssshot

I saw this rather handy tip on CSS reload­ing on Mark Jaquith’s blog today.  Such a simple approach, but a great one for when you’re mak­ing CSS changes and need browsers to pick up on it imme­di­ately, rather than some hours down the line.

Some changes are crit­ical.  Now you can ver­sion your css by hand, but you don’t have to.

The basis of the change is to use the code:

<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.css?v=<?php echo filemtime(TEMPLATEPATH . '/style.css'); ?>" type="text/css" media="screen, projection" />

But for the detail, go read Mark’s post.

Leave a Comment

Threaded commenting powered by Spectacu.la code.