Instead of modifying the jcrop css file (not recommended, according to the author of the plugin), you can add the class to the jcrop-holder element as an option when you initialize Jcrop:
jQuery(function($) { $('#jcrop_target').Jcrop({ addClass: 'jcrop-centered' }); });
Add a wrapper around the img tag in your HTML, e.g.
<div class="crop-image-wrapper"> <img id="jcrop_target" src="...." alt="" /> </div>
Then add css style like
.jcrop-centered { display: inline-block; } .crop-image-wrapper { text-align: center; }
Tested in Chrome 31.0.1650.63 m - tell me if it does not work in other browsers? (except <IE8) :-)
Chris
source share