Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javafx: Menu background css

Tags:

css

javafx

I am creating new application in Javafx and I have created Menu bar from javafx fxml and for that css is used to style it. But problem is that parent menu background changes to blue when I hover to sub menu item.


1 Answers

To do that, not only the context-menu class needs a custom rule, but also the menu-item and menu classes, e.g.:

.menu, .menu-item, .context-menu {
    -fx-background-color: crimson;
}
like image 195
fabian Avatar answered Dec 09 '25 20:12

fabian