The HTML editor is the authoring environment for your macro content. It opens in a full-screen panel when you add or edit an HTML macro on a Confluence page.

The editor is split into two resizable panels:
Drag the divider between panels to resize them to your preference.
Write the markup for your content. Standard HTML5 is fully supported. You do not need to include <html>, <head>, or <body> tags — just write the body content directly.
<div class="announcement">
<h2>📣 Team Update</h2>
<p>The Q2 roadmap has been published. <a href="/wiki/spaces/PROD">View it here.</a></p>
</div>
Write styles scoped to your macro. You have full access to CSS3 features including flexbox, grid, custom properties, animations, and media queries.
.announcement {
background: #e3fcef;
border-left: 4px solid #00875a;
border-radius: 4px;
padding: 16px 20px;
}
.announcement h2 {
margin: 0 0 8px;
font-size: 1rem;
color: #006644;
}
Write vanilla JavaScript to add interactivity. Your script runs inside a sandboxed iframe. Standard browser APIs (document, fetch, localStorage, setTimeout, etc.) are all available.
document.querySelectorAll('.tab-btn').forEach(btn => {
btn.addEventListener('click', () => {
document.querySelector('.tab-btn.active').classList.remove('active');
btn.classList.add('active');
});
});
Note: External scripts loaded via
<script src="...">are subject to the CSP security settings configured by your admin.
Click the Settings icon in the bottom toolbar to configure:
| Setting | Description |
|---|---|
| Theme | Light (tomorrow) or dark (monokai) editor theme |
| Font Size | Code font size in pixels |
| Tab Size | Spaces per indentation level |
| Line Numbers | Show or hide line numbers |
| Auto-complete | Enable bracket/tag completion |
| Live Preview | Toggle real-time preview updates |
| Auto-save | Automatically save drafts on a timer |
| Button | Action |
|---|---|
| Save | Save content and close editor |
| Cancel | Discard changes and close editor |
| Export | Download all three files as a .zip |
| Settings | Open editor preferences |
| Shortcut | Action |
|---|---|
Ctrl/Cmd + S |
Save |
Tab |
Indent selected lines |
Shift + Tab |
Unindent selected lines |
Ctrl/Cmd + / |
Toggle comment |
style="" attributes — your CSS is applied globally to everything in the HTML tab.