Rounded Corners in Drupal 7 (jquery corner)

Last updated on
8 September 2016

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

This is a short and painless intro into generating lovely rounded corners for your divs in Drupal 7.

  • Download the latest version of jquery-corner from http://jquery.malsup.com/corner/.
  • Save it under YOURTHEME/js/jquery.corner.js
  • Create an empty file YOURTHEME_corner.js in the same directory
  • In your already existing YOURTHEME.info, add scripts[] = js/jquery.corner.js and scripts[] = js/YOURTHEME_corner.js
  • Flush your cache!!!!!
  • and follow the instructions below

In the YOURTHEME_corner.js, add the following:

(function ($) {
  Drupal.behaviors.YOUTHEME = {
    attach: function(context, settings) {
      // list every element that you would like to adorn with corners below
      $("#block-user-login h2").corner("tl tr 4px"); // this is just an example, customize as you'd like, tl = top left
    }
  }
})(jQuery);

Done! For questions, contact me at www.ZUROSS.com.

Help improve this page

Page status: No known problems

You can: