Skip to main content
Custom Code

Use built-in features to add in custom code to your pages such through the Code Block or page settings.

Cody Walton avatar
Written by Cody Walton
Updated over 8 months ago

Adding code to your site is an advanced modification that falls outside of the scope of SnapPages support and will be best handled by the developer of the code.

While we can't help you troubleshoot or provide specific directions for custom code modifications, below are some resources that can help point you in the right direction.

Supported Code

Client-side code that is executed by a browser (Chrome, Firefox, Safari, etc.) are all examples of code that can be used on your site:

  • HTML

  • CSS

  • JavaScript

Unsupported Code

Server-side code is code that is handled by a server, not by a browser and this is not supported:

  • PHP

  • Ruby

  • Ruby on Rails

  • SQL

  • etc

Differences between HTML, CSS, and JavaScript

  • HTML - This is the code used to add content to a web page. When you add a Section or a Block, you're adding HTML to your site.

  • CSS - This is the code used to add style and design to a website. Our themes have built-in CSS, and all themes, blocks, and sections have style options that allow you to customize your CSS.

  • JavaScript - This is the code used to add action to a web page. JavaScript works behind the scenes to make things like section slides and animation happen.

What changes can I make?

If you plan to add custom code, we highly recommend that you have web development knowledge or are working with a 3rd party. We urge you to proceed with caution, and for best results, consult with a developer for help with any of these changes and modifications.

HTML and JavaScript

There isn’t a limit to what you can do with HTML and JavaScript, but you may run into some difficulties with styling as it may conflict with our templated CSS.

CSS

CSS should be used only for changing fonts, colors, and backgrounds. If you decide to apply custom CSS to your site, it should be used sparingly.

You should not use CSS to adjust the layout of your site.

By changing characteristics like Padding, Margins, and Positioning you may interfere with the multiple aspects of your theme as well as future improvements to SnapPages. As this is the case, these types of changes should all be done natively on our platform.

Custom Class on Blocks

You can add a custom class name to an individual block on a page that will allow you to more easily target and re-use custom styles that they add giving them more flexibility and power to customize your site.

To apply the custom class, add the CSS to the code of your site, then use the block options to reference the specific class.

External Resources

Here are a few websites we recommend for tutorials, troubleshooting, and reference guides to working with custom code:

Did this answer your question?