HTML transparent background color over other placed object?
Hi, Andrew. Love this tool. I have a special application where I want to superimpose HTML-based text blocks over background widgets (I'm actually placing HTML over SVG polygons). I'd like to have the HTML text overlay with a transparent background, i.e., a multiply, to let the background object show through as the background for the HTML.
I've tried changing for example, HtmlLabel(...background="none" and bg="#00000000"), but HtmlLabel() doesn't seem to recognize either of those switches. Styling the CSS with { background-color: transparent; opacity: 0.0 } also doesn't work. I can change the background color, but apparently not its transparency, unless I'm missing something.
I'm wondering if there's a right way to do this and, if not, whether HtmlLabel() can be modified to inherit Label()'s background transparency feature.
Hi! Apologies about the delay. I don't believe this is possible. While HtmlLabel can be styled using ttk, as far as I've been able to tell, the underlying Tkhtml widget inside doesn't support transparency. Perhaps you could layer the SVG polygons on top of the HTML instead? Sorry I couldn't be more helpful here.
Putting SVG polygons over the HTML is only relevant if the polygons are not colored. In my case, they're being used as background shapes bounding the HTML. It works reasonably well except for the transparency. The only workaround I could think of was to color the HTML background the same as the SVG.