Skip to content

How to display(HTML("<style>. #3639

Open
@runfish5

Description

@runfish5

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-code display(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?
image

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions