border-radius在dompdf中不起作用

时间:2014-09-25 08:40:50

标签: php dompdf

我的边框半径设置无效dompdf。这是我的代码:

$html ='
<style>
#test {
    background-color:blue;width:450px;height:800px;z-index:50;
    -moz-border-radius-bottomright: 750px 150px;
    border-bottom-right-radius: 750px 310px;
    -moz-border-radius-bottomleft: 500px 120px;
    border-bottom-left-radius: 450px 165px;
}
</style>
<div id="test">

</div>
';

$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();

3 个答案:

答案 0 :(得分:1)

我查了border-radius sample并发表了一些评论:

  • 看起来他们正在使用正常的样式名称,而不是Mozilla特定的名称。
  • 可能只支持border-radius,而不支持border-xxxx-yyyy-radius
  • 您使用的半径值非常大,从较小的值开始。

按照示例,这应该有效:

$html ='
<style>
#test {
    background-color:blue;width:450px;height:800px;z-index:50;
    border-radius: 0px 0px 100px 100px;
}
</style>
<div id="test">

</div>
';

答案 1 :(得分:0)

如果在当前的DOMPDF版本0.8中存在相同的问题,则支持边界半径功能。

我还使用了0.6版本,因此无法正常工作。

答案 2 :(得分:0)

添加下面的 css 对我有帮助,希望对你有用。

<块引用>

显示:内联块;