As noted in the comments, the correct property is named color
not colour
, with that in mind, I'd do away with the font
element completely, as its long since deprecated and change your code to, e.g:
self.key = QtGui.QTextBrowser(self)
self.key.setHtml(
"""<body>
<h1>Key</h1>
<div style='color:red;'>
GREEN = Overall Progress is 80% or above
YELLOW = Overall Progress between 65%-79%
Orange = Overall Progress is 64% or below
</div>
</body>"""
)
Even better would be to use an external stylesheet to move your CSS out of being inline, and then apply a class to the div
. In addition, all elements should reside within the body
tags, so you should also move your h1
below body
With that in mind, I'm not familiar with QTextBrowser
however.