Description
Problem
-
There is no example showing how to use
ipywidgets.HTML()
. If there was, I wasn't able to use it in google colab. It took me about two months get my first widgets being styled with the additional HTML-codedisplay(HTML(...
&.add_class("var")
. -
I'm also interested in one particular example, but I do not know if that is possible with ipywidgets.
This particular case is, how to change the ipywidgets.IntText
input font size?
I was able to change font-size of the ipywidgets SelectMultiple
and Textarea
with this code:
from ipywidgets import HBox, Textarea, SelectMultiple, HTML
display(HTML("<style>.mytext > select,.mytext > textarea {font-style: italic;color: blue;font-size: 30px;}</style>"))
display(HTML("<style>.font_small > select {font-size: 11px; padding: 0px 0px; background-color: #4CAF50;color: blue;}</style>"))
w2= Textarea(value="Here it is")
w2.add_class("mytext")
w1= SelectMultiple(options='sess')
w1.add_class('font_small')
display(HBox([w1, w2]))
But I could't find the right code for the part: display(HTML("<style>.mytext >
.
Suggested Improvement
-
I made a small collection of working codes and think it might be useful to other users:
https://gist.github.com/raven44099/7e0d239a06ca8caf32ec71dbd162d31c#file-ipywidgets-html_colab_examples-ipynb -
An instruction on how to find the correct keyword, like
select
indisplay(HTML("<style>.mytext > select
for the case ofipywidgets.SelectMultiple
would be helpful.