我有 css 样式类:
.customTabPane {
-fx-tab-min-height: 20;
}
.customTabPane:top *.tab-header-area {
-fx-background-insets: 0, 0 0 1 0;
-fx-padding: 5 0 0 0;
}
.customTabPane:top *.tab {
-fx-padding: 0 0 0 0;
}
.customTabPane *.tab-header-background {
-fx-background-color: red;
}
但是 *.tab-header-area, *.tab-header-background 适用于应用程序中的所有 TabPane-s,而不仅仅是“customTabPane”(tabPane.getStyleClass().add("customTabPane")
)。我怎样才能解决这个问题?