Skip to the content.

HTML & CSS Support

PeachPDF renders a subset of the HTML and CSS specifications. This page documents exactly what is and is not supported. Where a feature is only partially supported, the specific gaps are noted.


HTML Elements

Document Structure

Element MDN Reference Notes
html html Full support
head head Processed for <style> and <link rel="stylesheet"> children; other children are ignored
body body Full support

Metadata

Element MDN Reference Notes
style style Inline stylesheets are applied
link link Only rel="stylesheet" is processed; other link types are ignored
meta meta Ignored at render time
title title Ignored; the PDF document title must be set via PdfGenerateConfig

Sections

Element MDN Reference Notes
article article Rendered as a block
aside aside Rendered as a block
details details Rendered as a block; the open/close toggle is not supported — content is always visible
dialog dialog Rendered as a block; open/close behavior is not supported
figure figure Rendered as a block
figcaption figcaption Rendered as a block
footer footer Rendered as a block
header header Rendered as a block
hgroup hgroup Rendered as a block
main main Rendered as a block
nav nav Rendered as a block
search search Rendered as a block
section section Rendered as a block
summary summary Rendered as inline text; the disclosure triangle is not rendered

Content Grouping

Element MDN Reference Notes
address address Rendered as a block
blockquote blockquote Rendered as a block with default margin
center center Deprecated element; rendered with text-align: center
dd dd Full support
dir dir Deprecated element; rendered as an unordered list
div div Full support
dl dl Full support
dt dt Full support
fieldset fieldset Rendered as a block with a border; no interactive behavior
form form Rendered as a block; form submission is not supported
hr hr Full support
li li Full support
menu menu Deprecated element; rendered as an unordered list
ol ol Full support
p p Full support
pre pre Full support
ul ul Full support

Headings

Element MDN Reference Notes
h1 h1 Full support
h2 h2 Full support
h3 h3 Full support
h4 h4 Full support
h5 h5 Full support
h6 h6 Full support

Inline Text

Element MDN Reference Notes
a a href links are embedded as clickable PDF hyperlinks. Anchor links (href="#id") for in-document navigation are also supported. Elements with id or name attributes act as anchor targets only
b b Full support
bdo bdo Full support
big big Deprecated element; rendered with a larger font size
br br Full support
cite cite Rendered as italic
code code Rendered in a monospace font
del del Rendered with strikethrough
em em Rendered as italic
i i Rendered as italic
ins ins Rendered with underline
kbd kbd Rendered in a monospace font
s s Rendered with strikethrough
samp samp Rendered in a monospace font
small small Rendered with a smaller font size
span span Full support
strike strike Deprecated element; rendered with strikethrough
strong strong Rendered as bold
sub sub Full support
sup sup Full support
tt tt Deprecated element; rendered in a monospace font
u u Rendered with underline
var var Rendered as italic

Tables

Element MDN Reference Notes
table table Full support
caption caption Full support
col col Width attribute is applied
colgroup colgroup Full support
tbody tbody Full support
td td colspan and rowspan are fully supported
tfoot tfoot Full support
th th colspan and rowspan are fully supported; rendered as bold and centered by default
thead thead Full support
tr tr Full support

Embedded Content

Element MDN Reference Notes
img img Full support; images are loaded via the configured network loader. Data URIs are supported
iframe iframe Rendered as a placeholder box with a gray border. For YouTube and Vimeo embed URLs, a video thumbnail image is displayed

Forms

Form elements are rendered as static boxes. There is no interactive behavior — inputs cannot be focused or edited, and forms cannot be submitted.

Element MDN Reference Notes
button button Rendered as a static inline-block box
input input Rendered as a static inline-block box; no interactivity
select select Rendered as a static inline-block box
textarea textarea Rendered as a static inline-block box

Scripting

Element MDN Reference Notes
script script Completely ignored; JavaScript is not executed
noscript noscript Content is always rendered, because JavaScript is never executed

Legacy Frames

Element MDN Reference Notes
frame frame Deprecated element; no frame content is loaded
frameset frameset Deprecated element; rendered as a block
noframes noframes Deprecated element; content is rendered

CSS Properties

Box Model

Property MDN Reference Notes
width width Full support
height height Full support
max-width max-width Full support
min-height min-height Full support
margin margin Shorthand and all four longhands (margin-top, margin-right, margin-bottom, margin-left) are supported
padding padding Shorthand and all four longhands (padding-top, padding-right, padding-bottom, padding-left) are supported
box-sizing box-sizing content-box and border-box are supported

Borders

Property MDN Reference Notes
border border Shorthand supported; also border-top, border-right, border-bottom, border-left
border-width border-width Shorthand and all four longhands supported
border-style border-style Shorthand and all four longhands supported; values: none, solid, dashed, dotted, double, inset, outset, groove, ridge
border-color border-color Shorthand and all four longhands supported
border-collapse border-collapse Full support for tables
border-spacing border-spacing Full support for tables

Border Radius (PeachPDF Extension)

PeachPDF uses custom property names for border radius rather than the standard border-radius. Standard border-radius is not recognized.

Property Equivalent standard CSS Notes
corner-radius border-radius Sets all four corners
corner-nw-radius border-top-left-radius Top-left corner
corner-ne-radius border-top-right-radius Top-right corner
corner-se-radius border-bottom-right-radius Bottom-right corner
corner-sw-radius border-bottom-left-radius Bottom-left corner

Backgrounds

The background shorthand is not supported. Use individual properties.

Property MDN Reference Notes
background-color background-color Full support
background-image background-image URL and data URI values supported; CSS gradient functions (linear-gradient, etc.) are not — use background-gradient instead
background-position background-position Full support
background-repeat background-repeat Full support
background-attachment background-attachment Parsed and accepted but has no effect
background-clip background-clip Parsed and accepted but has no effect
background-gradient (PeachPDF extension) Sets a linear gradient on the background; value is a color
background-gradient-angle (PeachPDF extension) Angle in degrees for background-gradient

Color & Typography

Property MDN Reference Notes
color color Full support including named colors, hex, rgb(), rgba()
font font Shorthand supported; all components are parsed
font-family font-family Full support; generic families (serif, sans-serif, monospace) resolve to system fonts
font-size font-size Full support including absolute sizes (medium, large, etc.), relative sizes (smaller, larger), lengths, and percentages
font-style font-style normal, italic, oblique
font-variant font-variant normal and small-caps
font-weight font-weight Keyword (bold, normal, lighter, bolder) and numeric (100900) values
line-height line-height Full support
vertical-align vertical-align baseline, sub, super, top, middle, bottom, and length/percentage values

Text Layout

Property MDN Reference Notes
direction direction ltr and rtl
text-align text-align left, right, center, justify
text-decoration text-decoration Shorthand supported
text-decoration-color text-decoration-color Full support
text-decoration-line text-decoration-line none, underline, overline, line-through
text-decoration-style text-decoration-style solid, dashed, dotted, double, wavy
text-indent text-indent Full support
white-space white-space normal, nowrap, pre, pre-wrap, pre-line
word-break word-break normal, break-all, keep-all
word-spacing word-spacing Full support

Display & Layout

Property MDN Reference Notes
display display block, inline, inline-block, none, table, table-row, table-cell, table-header-group, table-footer-group, table-row-group, table-column, table-column-group, table-caption, list-item. flex and grid are not supported
position position static, relative, absolute, fixed (renders ignoring page margins), sticky (treated as relative in PDF output since there is no scroll)
float float left, right, none
clear clear left, right, both, none
overflow overflow Affects clipping regions; there is no interactive scrolling in PDF output
visibility visibility visible, hidden
z-index z-index Full support for positioned elements

Positioning

Used with position: relative, absolute, or fixed.

Property MDN Reference Notes
top top Full support
right right Full support
bottom bottom Full support
left left Full support

Lists

Property MDN Reference Notes
list-style list-style Shorthand supported
list-style-type list-style-type disc, circle, square, decimal, lower-alpha, upper-alpha, lower-roman, upper-roman, none
list-style-position list-style-position inside, outside
list-style-image list-style-image URL values supported

Page Breaks

These properties control how content breaks across PDF pages. Both the legacy page-break-* names and the modern break-* names are recognized.

Property MDN Reference Notes
break-before / page-break-before break-before auto, always, page, avoid
break-after / page-break-after break-after auto, always, page, avoid
break-inside / page-break-inside break-inside auto, avoid

Tables

Property MDN Reference Notes
empty-cells empty-cells show, hide

Generated Content

Property MDN Reference Notes
content content Used with ::before / ::after pseudo-elements; string, counter, and none values supported
counter-reset counter-reset Full support
counter-increment counter-increment Full support
counter-set counter-set Full support
string-set string-set CSS Paged Media property for running headers/footers

CSS At-Rules

At-rule Notes
@font-face Full support; see Fonts
@media Not supported
@keyframes Not supported
@supports Not supported
@layer Not supported
@import Not supported

Unsupported CSS Features

The following CSS features are not supported: