php - 我可以在创建 PDF 时在 mPdf 中使用内联 css 吗?

标签 php html css mpdf

我已经用外部 CSS 做到了。 但是当我尝试使用内联 CSS 时,它不起作用。

我可以在创建 PDF 时在 mPdf 中使用内联 css 吗? 请指导我。

最佳答案

根据mPDF documentation ,是的:

The following are supported (in order of ascending priority - lower ones in list overwrite higher):

  • HTML attributes e.g. <div align="center"> (see supported HTML attributes)

  • CSS Stylesheets - included in header of HTML document or as <link /> or as @import()

    • html tags e.g. p { font-size:12pt; color:#880000; }
    • class e.g. .stylename { font-size:9pt; }
    • id e.g. #style { font-size:9pt; }
  • In-line CSS style e.g. <p style="font-family:monospace;">

(强调我的)

关于php - 我可以在创建 PDF 时在 mPdf 中使用内联 css 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40418535/

相关文章:

php - SQL 查询为每个 id 选择一个图像

php - APC 显示 100% 碎片

javascript - jQuery点击函数在另一个div中显示文本

html - 根据宽度缩放背景图像高度

html - 响应性不适用于忘记密码链接

javascript - 匹配元素的高度

php - 帮助开始使用 OO PHP 和 MySQL

php - 检测 JPEG 图像质量

html - 资源被解释为样式表但在控制台中以 MIME 类型文本/html 错误传输

用于交换元素的 Javascript 与 CSS