Code

Superscript All ® Trademark Characters

Automatically superscript all ® Trademark Characters on your Webflow site. Adding this Javascript and CSS allows your Webflow site to automatically superscript all ® trademark symbols on your Webflow site.

Superscript All ® Trademark Characters preview

Automatically superscript all ® Trademark Characters on your Webflow site. Adding this Javascript and CSS allows your Webflow site to automatically superscript all ® trademark symbols on your Webflow site.

How to add it

  1. Add the CSS to your pages head custom code section
  2. Add the Javascript to your pages body custom code section

The code

Javascript
                      <!-- Add to closing body section -->
<script>
$('body :not(script,sup)').contents().filter(function() {
    return this.nodeType === 3;
}).replaceWith(function() {
    return this.nodeValue.replace(/[™®©]/g, '<sup>$&</sup>');
});
</script>

                    
CSS
                      <!-- Add to head section -->

/*Style <sup> all elements*/
sup {
  position: relative;
  top: -0.5em;
  font-size: 60%;
}

                    

Browse similar code snippets

More from Corey Moen

Profile →

Similar code snippets

All code snippets →