它似乎与this重复,但它不起作用。具有不同名称的JavaFX 2类具有相同的css代码
两类存在延伸
HBox
,并有一个TextField
element.I对每一个StyleClass
这样说:
//for one class
getStyleClass().add("search-box");
//for the other class
getStyleClass().add("libraries-search-box");
,所以我对矫正他们的
TextField
的appearence与上面的css代码:
.search-box .text-field {
-fx-background-color: white;
-fx-background-insets:3.0;
-fx-background-radius: 5.0;
.....
}
.libraries-search-box .text-field {
-fx-background-color: white;
-fx-background-insets:3.0;
-fx-background-radius: 5.0;
....
}
我想更换了重复代码,我尝试:
.search-box , .libraries-search-box .text-field {
-fx-background-color: white;
-fx-background-insets:3.0;
-fx-background-radius: 5.0;
...//
}
,但它仅适用于“.libraries-search-box
”。怎么我得到得到它都工作?
.text-field需要在父母双方都在选择器 – rmlan