mPDF Manual – mPDF functions

SetDefaultBodyCSS()

(mPDF >= 4.2)

SetDefaultBodyCSS – Change default CSS properties at runtime

Description

void SetDefaultBodyCSS ( string $property , string $value )

Change default CSS properties at runtime. This changes the default CSS stylesheet values for the BODY element.

Parameters

$property

Specifies the CSS property to set. Any valid CSS property that mPDF supports for the BODY element e.g.

font-family, font-size, color

Case-insensitive

$value

$Specifies the value for the given property.

Examples

Example #1

<?php

$mpdf = new mPDF();

$mpdf->SetDefaultBodyCSS('color', '#880000');

$mpdf->WriteHTML('Hallow World should be in red');

$mpdf->Output();

?>