HTML Content: what’s supported in the editor, web view, and PDF
What inline CSS, images, and merge fields the HTML Content widget keeps on screen and in the PDF — and what is stripped from display even though it stays in the HTML box.
Written By Mike Forte
Last updated 9 days ago
Use HTML Content when you are building a custom layout in markup: a comparison grid, a branded intro, a two-column hero. This is not the Content & Products block. That block uses the formatted-text editor (and its Source code button), which rewrites most layout CSS. HTML Content is a plain HTML box. In edit mode it shows only the code; once you save, the block renders on the quote. It keeps far more of what you paste.
How to add the widget, copy merge fields, and work with languages is in HTML content, variables, languages, and starter templates. This article is the support list: what you can rely on in the editor, the customer web view, and the PDF.
Build on a test quote. Always check Preview (the eye icon in the right-hand sidebar) or Presentation view (the play icon), then download the PDF, before you reuse the block with customers.
The three surfaces
There is no live preview while you edit the code. Click the save icon on the widget toolbar; the block then renders on the quote canvas.
Don't confuse the two eye icons: the one on the widget toolbar hides that block from customers (it asks you to confirm first). The one in the right-hand sidebar previews the quote.
Style blocks, scripts, and click handlers stay in the box but are removed when the quote is displayed. Put all styling on the tags (style="…").
Put CSS on the tags (inline styles)
Write styles on the element, for example style="display: flex; gap: 16px". That is the format that survives the quote canvas, Preview, presentation view, the customer web view, and the PDF together.
These inline properties are kept:
Class names and ids on tags are kept, but a class does nothing unless its rules are also inline. There is no stylesheet you can attach to the widget.
CSS variables only resolve if you define them on a parent with an inline style (style="--brand: #1a1a1a") or give a fallback (var(--brand, #1a1a1a)). Do not assume Salesbuildr’s own theme variables are available on the customer view or the PDF.
Quoted grid area names (grid-template-areas: "a b") can be dropped. Prefer grid-template-columns and grid-template-rows.
Do not rely on media queries. Those live in a <style> block, which is stripped on screen. For a layout that wraps on a phone, use display: flex with flex-wrap: wrap and flex: 1 1 180px on the children, or display: grid with grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)).
A wide table can overflow the page in the PDF. Wrap it in <div style="width:100%;overflow-x:auto">. Do not nest a wide table inside another table’s cell — that can push the whole block past the edge of the page.
Do not paste this kind of layout into Content & Products → Source code. That editor keeps little more than text alignment and simple width/height. Use HTML Content for flex, grid, shadows, and gradients.
What is stripped on screen
Before the quote canvas, Preview, presentation view, or customer web view shows the block, Salesbuildr removes:
<style>blocks — a<style>.card { … }</style>section does not style the on-screen quote. Put those rules on the tags instead.<script>tags — JavaScript never runs in the quote.- Event attributes such as
onclick,onerror, andonload— clicks and image-error handlers do not fire. <iframe>,<object>,<embed>, and<link rel="stylesheet">— no embedded pages and no external stylesheets.javascript:links — the address is removed.
The HTML box still contains what you typed. Open the widget later and the <style> block or onclick is still there. It just does not take effect when the quote is displayed — on the quote canvas after you save, in Preview, in presentation view, or on the customer web view. If a layout looks empty after you save but “should” be styled, look for a style block and move those rules onto the tags.
The PDF is built from the stored HTML, so a style block that the on-screen views hid can still change the PDF. Treat that as a mismatch to fix (move the CSS inline), not as a way to style only the file.
Collapsible sections (<details>) stay in the HTML, but they print closed in the PDF. Do not hide content the buyer needs to see on paper.
Links keep their address and always open in a new tab.
Images and SVG
These work in HTML Content:
<img>with anhttps://address.<img>with a data URI for a raster image (data:image/png;base64,…, JPEG, GIF, or WebP).- Inline SVG (
<svg>…</svg>in the HTML). Event handlers and scripts inside an SVG are stripped; the drawing is kept.
Prefer an uploaded image (or a merge-field image snippet from Available template variables) over a huge data URI. Formats that hold up in both the web view and the PDF are JPEG, PNG, GIF, and WebP. SVG usually looks sharp on screen; the PDF may rasterize it. Details are in HTML content, variables, languages, and starter templates (image snippets) and the image notes in Building widgets without starting from scratch.
Merge fields and if / each
HTML Content is a Handlebars template. Copy fields from Available template variables in the Edit tab instead of typing them. The same panel has copyable examples for:
- Only if a value exists —
{{#if quote.total.month}}{{quote.total.month}}{{/if}} - If / else — show one thing when a value is present and another when it is not
- A list of line items —
{{#each quote.items}}…{{/each}}
Inside {{#each quote.items}} each line exposes quantity, title, description, and the two leasing flags. It does not expose prices, SKUs, or tax. Use a Content & Products widget for a priced table.
Wrong merge-field syntax (a broken {{#if}} or {{#each}}, for example) is not a silent blank. The quote can show an inline message starting with There is error processing variable. Saving a widget template shows that same message and does not save until you fix it. Copy from the list rather than editing tokens by hand. A field that simply has no value (no company name, no PSA id) renders as empty — that is not an error.
Full field groups (company, contact, owner, quote totals, custom fields) are in HTML content, variables, languages, and starter templates.
When variables fill in
The Available template variables list uses sample values (for example a placeholder company name) so you can see what a field will become. A live quote uses that quote’s company, contact, totals, and line items.
Check three things, in this order:
- Save, then look at the quote canvas — layout, inline CSS, and filled-in fields.
- Preview (eye icon in the right-hand sidebar) or Presentation view (play icon) — the quote as the buyer will see it, including mobile and desktop.
- Download the PDF (download icon in the right-hand sidebar, or Download PDF in presentation view) — filled-in fields and print layout (tables that fit on screen can still overflow the page; collapsible sections print closed).
A layout that will survive
- Add HTML Content from Insert Quote Widget (see HTML content, variables, languages, and starter templates).
- Paste a fragment — headings, divs, tables, images — not a full HTML document (
<html>,<head>, a<style>block, or scripts). - Use inline
style="…"for flex, grid, spacing, colour, radius, shadow, and gradients. - Copy merge fields from Available template variables. Use
{{#if}}/{{#each}}from the examples at the bottom of that list. - Click the save icon on the widget toolbar and confirm the canvas shows the layout without depending on a style block.
- On a test quote, open Preview or Presentation view, then download the PDF. If they disagree, a style block or a token is usually the reason. Wrap wide tables as above, and keep anything the buyer must see on paper outside a collapsible section.
Save the finished block as a linked widget when you want it on more than one template — Building widgets without starting from scratch.
See also
- HTML content, variables, languages, and starter templates — how to add the widget, copy variables, and languages
- Building widgets without starting from scratch — paste, check presentation view and PDF, save as a linked widget
- Quote Editor — presentation view, downloading the PDF, and widget types
- Quote Templates — library strategy and linking widgets
Was this helpful?
More in Best Practices
Quoting best practices for new quotersQuoting labor and projectsSet up Salesbuildr in this orderPSA integration best practicesStill need help? Ask the team