Return to Snippet

Revision: 13592
at April 28, 2009 18:03 by dougunderscorenelson


Initial Code
$("hr").each(function() {
  var hrClass = jQuery(this).attr("class")
  $(this).wrap("<div class='hr " + hrClass +"'></div>");
});

Initial URL

                                

Initial Description
HRs are a pain in the ass to style, so why bother? Wrap them in a DIV with a class of HR instead. (In your stylesheet, set .hr hr { display: none }).

This also ports the class of the HR up to the new parent DIV, allowing you to make a few different HR types that clients can easily work with.

Initial Title
Wrap Your HRs for Easy Stylin'

Initial Tags
jquery

Initial Language
jQuery