Novice question re media attribute


#1

Please excuse me if this is really basic, but I’m a total novice and will probably use the wrong terminology in this question!

What do I need to add to the following so that the background colours are visible when the report is printed? Currently, I can only see the colours on screen.

<div style=''>
  <div style='width: 50%; border: 1px solid rgb(0, 0, 0);'>
    <div style='font-family: Arial; font-size: 13px; font-weight: bold; text-align: center; background-color: rgb(54, 189, 53);'>${Label element} </div>
  </div>
  <div style='width: 50%; border: 1px solid rgb(0, 0, 0);'>
    <div style='font-family: Arial; font-size: 13px; background-color: rgb(54, 189, 53);'>${Value element} </div>
  </div>
</div>

Thanks in advance!!


#2

You do not have any text. You will need to supply the values in your <div></div> tags… You’ll replace Label/Value element with a variable name, that contains the data, most likely.

Other than that, your background colours should be displayed on the divs, and when you print the webpage, it will contain these colours.


#3

@825orion

Hi - thanks for getting back to me! I’m not really sure what you mean :confused: …the label and value elements relate to the field titles and the content within those fields - please see attached screenshot where, for example: Proactive strategies to help me stay happy and calm is the label element.


#4

define printed, like printed with a printer?


#5

Yes…printed with a printer


#6

there are existing stack-overflow questions which cover this:

https://stackoverflow.com/questions/14987496/background-color-not-showing-in-print-preview

i highly recommend reading them.


#7

Thank you! I’ll give the suggestions a try tomorrow :crossed_fingers:


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.