Mik*_*son 3 css java javafx background-color
我有一个 CSS 文件可以在 JavaFXTabPane和Tab.
有没有办法设置TabPane的背景颜色并继承Tab背景颜色?
如果我设置了tab-content-area背景颜色,我可以在没有再次特别指定颜色的情况下为选项卡选择它吗?
.tab-content-area
{
-fx-background-color: #d9d9d9; /* I want to apply this color to tab background */
}
.tab:selected
{
-fx-background-color : -fx-something; <?? what do i put here??>
-fx-background-insets: 0, 1 1 0 1;
-fx-background-radius: 5 5 0 0, 4 4 0 0;
}
Run Code Online (Sandbox Code Playgroud)
您可以设置Tab transparent或的背景inherit:
.tab-content-area {
-fx-background-color: #d9d9d9; /* I want to apply this color to tab background */
}
.tab:selected {
-fx-background-color : transparent; /* Or: -fx-background-color : inherit;*/
-fx-background-insets: 0, 1 1 0 1;
-fx-background-radius: 5 5 0 0, 4 4 0 0;
}
Run Code Online (Sandbox Code Playgroud)
您可以在TabPane 此处查看 CSS 结构。
要了解有关 JavaFX 中命名颜色的更多信息,请参阅本节。
的文档inherit可以在这里找到。
| 归档时间: |
|
| 查看次数: |
2777 次 |
| 最近记录: |