This is an archived forum post. The information may be outdated. Contact us if you have any questions.

gradient background not working

philipfc wrote on 2013-08-26:
I am trying to get a gradient background to appear for a div and it is not appearing.

Please let me know if you see what is preventing the gradient background from appearing in a PDF when the background option is enabled.

<html>
  <head>
    <style>
      .risk-line {
        border-radius: 6px;
        height: 12px;
        background: #df5353; /* Old browsers */
        background: -moz-linear-gradient(left,  #df5353 0%, #df5353 5%, #dddf0d 48%, #dddf0d 52%, #55bf3b 95%, #55bf3b 100%); /* FF3.6+ */
        background: -webkit-gradient(linear, left top, right top, color-stop(0%,#df5353), color-stop(5%,#df5353), color-stop(48%,#dddf0d), color-stop(52%,#dddf0d), color-stop(95%,#55bf3b), color-stop(100%,#55bf3b)); /* Chrome,Safari4+ */
        background: -webkit-linear-gradient(left,  #df5353 0%,#df5353 5%,#dddf0d 48%,#dddf0d 52%,#55bf3b 95%,#55bf3b 100%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(left,  #df5353 0%,#df5353 5%,#dddf0d 48%,#dddf0d 52%,#55bf3b 95%,#55bf3b 100%); /* Opera 11.10+ */
        background: -ms-linear-gradient(left,  #df5353 0%,#df5353 5%,#dddf0d 48%,#dddf0d 52%,#55bf3b 95%,#55bf3b 100%); /* IE10+ */
        background: linear-gradient(to right,  #df5353 0%,#df5353 5%,#dddf0d 48%,#dddf0d 52%,#55bf3b 95%,#55bf3b 100%); /* W3C */
        /* filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#df5353', endColorstr='#55bf3b',GradientType=1 ); */ /* IE6-9 */
        margin-bottom: 16px;
        width: 600px;
      }
    </style>
  </head>
 <body>
   abc
   <div class="risk-line">123 this</div>
 </body>
</html>
support wrote on 2013-08-27:
Hello,

Unfortunately, there is a bug in our software causing that a gradient fill is not printed when the containing element does not have a border.
philipfc wrote on 2013-08-27:
Got it. Thank you for the workaround.