Skip to main content
All CollectionsBuilding an Experience
How to align text on your calculator with Custom Javascript
How to align text on your calculator with Custom Javascript
Outgrow Team avatar
Written by Outgrow Team
Updated over 7 months ago

How to align text on your calculator with Custom Style Sheets

Text on a calculator can be aligned if you have access to Custom HTML or Custom JS. To align text on your calculator using custom JS simply open the Custom Javascript section on Configure tab under the calculator.

Alignment of text using Custom Style Sheets

Navigate to Custom Javascript on Configure. Open the preview of your calculator on a tab on your browser. Inspect the element which you want to align.

1351

Notice that the class of this element is the main heading.


Now, copy the following script. The following code will align the heading text correctly. For the proper alignment of other text on the calculator, inspect the element and replace the .main-heading class in the second line of code with the class of element which you want to align.

Code To User:

jQuery(document).ready(function(){ jQuery('.main-heading').attr('style', 'text-align: right !important'); });
2876
1351

If you have a calculator and want to align multiple elements to the right using one script, you can add all the classes to the same script separated by a comma. If you need help on how to include multiple classes in a script, here is some guidance.

If the script doesn't produce the desired results, you can make changes and resubmit it for moderation. Please note that any changes made to the script will require it to undergo moderation again.

Did this answer your question?