Skip to content

Instantly share code, notes, and snippets.

View peterhry's full-sized avatar

Peter Hrynkow peterhry

View GitHub Profile
@peterhry
peterhry / gist:019372e1b4e0efaed11d
Created July 18, 2014 16:25
jQuery Dropcaps - The CSS pseudo selector approach is too buggy. I’m using jQuery to wrap the first char in a style-able <span> instead.
$(document).ready(function () {
var p1 = $('.post-intro p').eq(0),
text = p1.text();
p1.html('<span class="dropcap">' + text.substr(0,1) + '</span>' + text.substr(1));
});