【发布时间】:2014-10-15 03:45:50
【问题描述】:
我正在使用 dompdf 创建 pdf 文件,但 float 属性不起作用。我将 DOMPDF_ENABLE_CSS_FLOAT 更改为 true。它在普通 php 中运行良好,但在 laravel 4 中无法运行。
这是我的代码。
<!doctype html>
<html lang="en">
<head>
<style type="text/css">
.left {
float: left;
outline: 1px solid green;
width: 6cm;
}
.right {
float: left;
outline: 1px solid blue;
width: 6cm;
}
</style>
</head>
<body>
<div class="left" style="float:left;">left boxes here</div>
<div class="right" style="float:right;">right boxes here</div>
</body>
</html>
谢谢。
【问题讨论】:
-
CSS 的其余部分是否正确加载?您可以尝试在运行时检查浮动设置:
$dompdf->get_option('enable_css_float');.
标签: php laravel-4 dompdf html-to-pdf