🔥 Gravity PDF v3 end of life was 2017-06-20 and this version is no longer supported. This legacy documentation is kept for reference only.
Example of Floated and Fixed Positioning in PDF Templates
Floats and Fixed PositioningThe plugin ships with a number of PDF templates showing off the features of mPDF. These can be found in your PDF_EXTENDED_TEMPLATES directory.
Floats and fixed positioning is partially supported in mPDF but doesn’t conform to all requirements of the W3 CSS2 specification.Download Example PDF
- Only block elements can be floated.
- Floats only work if a width is set on the element
Clearing FloatsThe CSS
clearproperty can be set on all block elements, as well as
Positioning LimitationsThe CSS
positionproperty supports the
absolutevalues. The absolute parameter will treat the entire page as the containing element while
fixedis bound to the page margin container.
- Only block-level elements can be positioned.
- The block-level element you want positioned needs to be a direct child of the
<body>tag. Positioning won't work if the element is nested.
- All positioning is relative to the current page.
overflow: autocauses text to auto fit within the block size.
- You cannot nest fixed position or floated elements inside other fixed position elements.Setting
overflow: auto;on positioned elements can cause long PDF generation times.
Rotating Positioned ElementsLike the CSS table
rotateproperty, positioned elements can also be rotated 90 degrees.