How to use a custom HTML code on my website?

You can add your own HTML code, CSS formatting and JavaScript to your website using the Custom code element.

To add it to your website:

  1. When in the Website Builder editor, click on the Add elements button.
  1. Drag and drop the Custom code element into your page content. Note that the editor will highlight the spots where you can drop it.
  1. Click inside the Custom code object to open the toolbar and enter your code in the editor on the right.

Note: Issues within your code may disrupt the visual structure of your website, potentially rendering it unreadable. Such issues can interfere with the functionality of any JavaScript you implement, which may negatively affect your website’s layout, positioning, and visibility in search engine results.

The code editor will display an error message if the code is incomplete, syntactically incorrect, contains deprecated attributes, or presents other issues. Despite these warnings, it will still be possible to save changes at your own risk.

code editor error

What types of code can I use?

  • HTML
    use standard HTML formatting, for example:
    <p> </p>

  • CSS
    place your CSS code between the style tags:
    <style> </style>

  • JavaScript
    place your JS code between the script tags:
    <script> </script>

If you want to use Less or Sass formatting, you need to compile it to CSS first and then place it between the style tags:
<style> </style>

Absolute positioning

Enable this option to move the custom code to any place on your website.

Note: we only recommend using this option if you have some unusual design the can’t be created in any other way. Using objects with absolute positioning can make your page less responsive on mobile devices.

Hide on mobile devices

Enable this option to hide your code while your page is opened on a mobile device.
You may want to use this option to make your page simpler for mobile users, for example when you are adding the same CTA button a few times for desktop view.