/ Published in: jQuery
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.
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.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$("hr").each(function() { var hrClass = jQuery(this).attr("class") $(this).wrap("<div class='hr " + hrClass +"'></div>"); });