Roy Shmuli
Roy Shmuli

Reputation: 5019

JavaFX hover only when not selected CSS

I have CSS for hover and selected etc:

.my-class-name:hover
{
    .fx-background-color: red;
}
.my-class-name:selected
{
    .fx-background-color: blue;
}

In this example the background of selected element is blue. Is there way when the mouse hover the selected element it will stay with background blue?

Upvotes: 3

Views: 274

Answers (1)

NM Naufaldo
NM Naufaldo

Reputation: 1160

I have same problem, try this one :

.my-class-name:hover
{
    .fx-background-color: red;
}
.my-class-name:selected
{
    .fx-background-color: blue;
}
.my-class-name:selected:hover
{
    .fx-background-color: blue;
}

Upvotes: 2

Related Questions