Greg Is correct. When you use a widget you in effect create a web page within a webpage.
The css styles that you put in the Head will only affect the parent webpage. and not the inner one within the widget.
To affect it you would have to run some javascript on it after it has loaded or add a complete web page scheme to the widgets innerHTML.
The preference though is to just use an Element which will be on the same plain of existence as the parent web page and therefore under the control of the Head where your css style is
I was sure I was missing something fundamental, and between Olav’s example and the explanations of what I was doing wrong, I’ve got it now. I had just assumed that HTML code belonged in an HTML widget.
In fact I’ve got it working two ways:
• with the CSS in the HEAD plus innerHTML in a text element
•with the entire HTML in a widget
Of course, I’ll obey MarkHunte’s advice and use the Element method.