skip to Main Content

Trying to style a label in mpdf and not working.

Have tried all of the three ways outlined below and none affect how its rendered. Has anyone found a way to style the label field? I understand not all CSS and HTML is supported but it does say it has support for labels.

<label style="color:#eeff00;" for="wf-s1-1" class="field-name">Theme:</label>

<style>
 label{
      color: #FF2200;
    }

 label.field-name {
      color: #FF2200;
    }
.field-name {
      color: #FF2200;
    }
</style>```

2

Answers


  1. Try using an ID instead of a class as the selector in your CSS:

    <label id="field-name">Theme:</label>
    
    <style>
    #field-name {
          color: #FF2200;
        }
    </style>
    
    Login or Signup to reply.
  2. Label tag is currently not recognized thus not stylable in mPDF.

    Feel free to propose a feature request at mPDF issue tracker at github to mitigate this.

    See https://mpdf.github.io/css-stylesheets/supported-css.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search