Change title color using html

If I want to bold a title I can do this

layout = go.Layout(title='Crosby <b>87</b> ')

However, if I want to change part of the title to another color I was thinking of doing

layout = go.Layout(title='Crosby <font color="red">87</font> ')

But it doesn’t work.

Any ideas?

1 Like

@alexpetit12 You can set the font color for the entire title not only for substrings of it.

layout=go.layout(title =  dict(text ='Your title',
                               font =dict(family='Sherif',
                               color = 'red')),

for more title attributes see

Hi @alexpetit12,

For a little context, plotly.js doesn’t support arbitrary HTML markup in labels. Here is a description of the subset that is supported Font colors must be specified in the font property as @empet described.