DocRaptor HTML TO PDF API

CSS & Stylesheets

Using CSS in DocRaptor is exactly the same as in normal web pages. You can embed your stylesheet with a style tag:

<style>
body {
  background-color: blue;
}
</style>

Or use inline styles:

<a href="https://docraptor.com" style="color: blue;">DocRaptor!</style>

Or link to an external stylesheets with absolute URLs (or define a baseurl for your document). While we fully support external stylesheets, it is slightly faster to use <style> tags because we don't have to fetch your CSS file.

<link rel="stylesheet" media="screen" href="https://yourdomain.com/stylesheet.css" />

Ready to get started? Try DocRaptor for free with unlimited test documents.