HTML & CSS Reference Guide
HTML & CSS Reference Guide
ChartHop's PDF renderer supports a specific subset of HTML and CSS. Use this reference when building or troubleshooting letter templates so you know exactly what will and won't work before generating a PDF.
Packages: Basic | Standard | Premium Roles: Owner | Technical Owner
Supported HTML tags
Tag | Notes |
|---|---|
<body> | Required wrapper. Without it, raw HTML tags appear as text in the PDF. |
<p> | Standard paragraph. Use for body copy. |
<h1> through <h6> | Standard headings. |
<table>, <tr>, <td>, <th>, <thead>, <tbody> | Full table support. Required for all multi-column layouts. |
<div> | Block container. Useful for page breaks and grouped sections. |
<span> | Inline container. |
<ul>, <ol>, <li> | Unordered and ordered lists. |
<strong>, <b> | Bold text. |
<em>, <i> | Italic text. |
<br> | Line break. |
<hr> | Horizontal rule. |
<img> | Images. Use absolute URLs (e.g., hosted on your CDN or ChartHop). |
<a> | Links. Rendered as clickable in PDFs that support it. |
<blockquote> | Quoted content. |
Unsupported HTML
Tag / Feature | What to do instead |
|---|---|
<svg> | Use <img> with a hosted PNG or JPG. |
<canvas> | Not supported. |
<video>, <audio> | Not supported. |
<iframe> | Not supported. |
JavaScript (<script>) | Not supported. Letter templates are static documents. |
Forms (<input>, <select>, etc.) | Not supported. Use ChartHop Forms instead. |
Emoji and non-standard Unicode | Emoji render as # or a blank box. Use plain text instead. |
Supported CSS properties
All CSS must be defined in the Stylesheet tab and applied with class="" attributes in the Content tab. Inline styles (style="") are sometimes ignored by the renderer — especially for layout-critical properties.
Property | Notes |
|---|---|
color | Hex, RGB, and named colors are supported. |
background-color | Supported on most elements. |
font-family | Use web-safe fonts (Arial, Helvetica, Georgia, Times New Roman, Courier New) or fonts embedded via your Stylesheet. |
font-size | px, pt, and em units work reliably. |
font-weight | bold, normal, or numeric values. |
font-style | italic, normal. |
text-align | left, right, center, justify. |
text-decoration | underline, none. |
margin, padding | Supported. Use shorthand or individual sides. |
border | Supported. See the note on table borders below. |
width, height | Supported. Prefer % for table columns; use px for fixed elements like logos. |
line-height | Supported. |
vertical-align | Supported on table cells. |
page-break-after, page-break-before | Supported via CSS class only. See the page breaks section below. |
list-style-type | Supported. |
Unsupported CSS
Property / Feature | What to do instead |
|---|---|
display: flex and display: grid | Use <table> with width percentages for multi-column layouts. |
CSS variables (--my-color) | Hardcode values in each rule. |
@import | Embed font definitions directly in the Stylesheet tab. |
Pseudo-elements (::before, ::after) | Not supported. |
Pseudo-classes (:hover, :focus) | Not applicable in a static PDF. |
Animations and transitions | Not supported. |
calc() | Not supported. Use fixed values. |
Table borders: the default override
ChartHop's default stylesheet applies a border to all tables:
table, tr, td, th { border: 1px solid gray; }This applies to every template unless you override it. If you want borderless tables (which is typical for multi-column layouts), add this to your Stylesheet tab:
table, tr, td, th { border: none; }You can then add borders back selectively to specific classes.
Page breaks
To force a page break at a specific point in your document:
- Add this rule to your Stylesheet tab:
.pagebreak { page-break-after: always; }- Place this in your Content tab wherever you want the break:
<div class="pagebreak"></div>Inline styles for page breaks are ignored by the renderer. The class-based approach is the only method that works reliably.
Fonts
The renderer supports the following fonts without any additional setup:
- Arial (recommended default)
- Helvetica
- Georgia
- Times New Roman
- Courier New
If your brand uses a custom font, embed it in the Stylesheet tab using a @font-face rule pointing to a hosted font file (.woff or .woff2). Always include a web-safe fallback:
@font-face {
font-family: 'YourFont';
src: url('https://your-cdn.com/fonts/yourfont.woff2') format('woff2');
}
body {
font-family: 'YourFont', Arial, sans-serif;
}Images
- Use <img src="..."> with an absolute URL. Relative paths are not supported.
- Host your images publicly (your CDN, an S3 bucket, or similar).
- Use width and height attributes or CSS to control dimensions.
- Supported formats: PNG, JPG, GIF. SVG is not supported — convert to PNG before embedding.
<img src="https://your-cdn.com/logo.png" alt="Company Logo" width="150">Multi-column layouts
Since flexbox and CSS Grid are not supported, use <table> for all side-by-side layouts. Set width as a percentage on each <td> to control column proportions.
Example: a two-column layout:
<table class="layout-table">
<tr>
<td style="width: 50%;">Left column content</td>
<td style="width: 50%;">Right column content</td>
</tr>
</table>And in the Stylesheet tab:
.layout-table, .layout-table tr, .layout-table td { border: none; }Keep table nesting to two levels where possible. Deeply nested tables are the most common cause of rendering artifacts.
Always verify with a downloaded PDF
The preview panel in ChartHop does not always match the final rendered PDF. Download the document before signing off on a template to confirm that layouts, fonts, and page breaks render as expected.
