B4J Question CSS and Material Icons

Firpas

Active Member
Licensed User
Longtime User
Hi to everybody

I'm trying to apply a css style to a label with font "Material Icons" with no result.

This the css entry:

B4X:
.mylabel {
    -fx-background-color: Transparent;
}
.mylabel:hover {
    -fx-background-color: #66CCFF;
}

This is the code :

B4X:
Sub Class_Globals
              .....
        Private LblClose, LblMax, LblMin As Label
End Sub

Public Sub Initialize(Parent As Form)
   ...
    FrmLogin.Stylesheets.Add(File.GetUri(File.DirAssets, "DeporWeb.css"))
    
    LblMin.StyleClasses.Add("mylabel")
    
    ...   
End Sub

And found attached an image from designer

Any idea??

Thanks
 

Attachments

  • Label.png
    Label.png
    9.6 KB · Views: 257

stevel05

Expert
Licensed User
Longtime User
It would be easier if you attached a working or non working project, but the attached works for me.
 

Attachments

  • CSSTest.zip
    2 KB · Views: 233
Upvote 0

Firpas

Active Member
Licensed User
Longtime User
I do not know what my mistake was, but your example works fine and now my proyect too.
Thank you very much.
 
Upvote 0
Top