简单的问题,但我找不到任何答案(我想我不知道该搜索什么...)。我如何防止我的工具提示显示一个丑陋的正方形,并将场景的背景图像作为背景,就像这张图片一样?!
这是我的CSS,我相信其中一些选项,例如按钮,正在影响工具提示...就像它们在代码的另一部分中影响我的日期选择器一样。我如何管理它们,使其没有这种副作用?是否简单地为特定对象(例如DatePicker或Tooltip)定义CSS就可以解决问题?
我正在使用JDK 8u11,MAC OS Mavericks。
这是我的CSS,我相信其中一些选项,例如按钮,正在影响工具提示...就像它们在代码的另一部分中影响我的日期选择器一样。我如何管理它们,使其没有这种副作用?是否简单地为特定对象(例如DatePicker或Tooltip)定义CSS就可以解决问题?
我正在使用JDK 8u11,MAC OS Mavericks。
.root {
-fx-background-image: url("media/background.jpg");
}
.button {
-fx-background-color:
linear-gradient(#686868 0%, #232723 25%, #373837 75%, #757575 100%),
linear-gradient(#020b02, #3a3a3a),
linear-gradient(#9d9e9d 0%, #6b6a6b 20%, #343534 80%, #242424 100%),
linear-gradient(#8a8a8a 0%, #6b6a6b 20%, #343534 80%, #262626 100%),
linear-gradient(#777777 0%, #606060 50%, #505250 51%, #2a2b2a 100%);
-fx-background-insets: 0,1,4,5,6;
-fx-background-radius: 9,8,5,4,3;
-fx-padding: 15 30 15 30;
-fx-font-family: "Arial Black";
-fx-font-size: 18px;
-fx-font-weight: bold;
-fx-text-fill: white;
-fx-effect: dropshadow( three-pass-box , rgba(255,255,255,0.2) , 1, 0.0 , 0 , 1);
}
.button:hover {
-fx-background-color:
linear-gradient(#757575 0%, #373837 25%, #232723 75%, #686868 100%),
linear-gradient(#3a3a3a, #020b02),
linear-gradient(#242424 0%, #343534 20%, #6b6a6b 80%, #9d9e9d 100%),
linear-gradient(#262626 0%, #343534 20%, #6b6a6b 80%, #8a8a8a 100%),
linear-gradient(#2a2b2a 0%, #505250 50%, #606060 51%, #777777 100%);
-fx-background-insets: 0,1,4,5,6;
-fx-background-radius: 9,8,5,4,3;
-fx-padding: 15 30 15 30;
-fx-font-family: "Arial Black";
-fx-font-size: 18px;
-fx-font-weight: bold;
-fx-text-fill: white;
-fx-effect: dropshadow( three-pass-box , rgba(255,255,255,0.2) , 1, 0.0 , 0 , 1);
-fx-cursor:hand;
}
.text-area *.text {
-fx-text-alignment: justify;
}
.text-area {
-fx-background-color: rgba(255,255,255,0.4);
}
.text-area .scroll-pane {
-fx-background-color: transparent;
}
.text-area .scroll-pane .viewport{
-fx-background-color: transparent;
}
.text-area .scroll-pane .content{
-fx-background-color: transparent;
}
.radio-button{
-fx-font-size: 14px;
-fx-font-family: "Arial Black";
-fx-fill: #818181;
-fx-effect: innershadow( three-pass-box , rgba(0,0,0,0.7) , 6, 0.0 , 0 , 2 );
}
node.setStyle("-fx-fill: red;")
以编程方式设置样式时,随后的setStyle
将覆盖先前的值,但不会清除外部样式表设置的样式。 - Tomas Mikula