Karthikeyan Ganesan
Karthikeyan Ganesan

Reputation: 2035

border-radius not working in dompdf

My border radius settings are not working in dompdf. Here is my code:

$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();

Upvotes: 0

Views: 7887

Answers (3)

Lokanath Nayak
Lokanath Nayak

Reputation: 1

Adding below css helped me, Hope that will work for you.

display: inline-block;

Upvotes: 0

sensi
sensi

Reputation: 569

If someone has the same issue in the current DOMPDF version 0.8 supports the border-radius feature.

I've also used the version 0.6 and there it doesn't work.

Upvotes: 0

huysentruitw
huysentruitw

Reputation: 28131

I looked up the border-radius sample and have some remarks:

  • it seems like they're using the normal style names, not Mozilla specific ones.
  • maybe only border-radius is supported and not the border-xxxx-yyyy-radius
  • the radius values you're using are very large, start with smaller values.

Following the example, this should work:

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

</div>
';

Upvotes: 2

Related Questions