css - 如何去除所选选项卡 Pane 中的蓝色

标签 css javafx-8

我正在开发 javafx 元素,我有一个 FXML 界面,我在其中放置了一个选项卡 Pane ,当我选择一个选项卡时,所选按钮的边框为蓝色,但我想要的样式是让白色颜色将不添加边框。

我的形象here有一个蓝色的轮廓。 tab with blue border

得到这个image

tab without blue border

我的用于设置选项卡 Pane 样式的 Css 代码:

.tab
{
    -fx-background-color: #fbfbfb;
    -fx-border-width: 0 0 1 0;
    -fx-border-color: #c2c2c2 #c2c2c2 #c2c2c2 #c2c2c2
}
.tab:selected 
{
    -fx-background-radius: 0;
    -fx-background-insets: 0;
    -fx-background-color: #fbfbfb;
    -fx-border-width: 0 0 3 0;
    -fx-border-color: #c2c2c2 #c2c2c2 #ff9500 #c2c2c2
}
.tab-pane *.tab-header-background 
{
    -fx-background-color: #fbfbfb, #fbfbfb, #fbfbfb;
    -fx-border-width: 1 0 1 0;
    -fx-border-color: #c2c2c2 #c2c2c2 #c2c2c2 #c2c2c2
}

最佳答案


To find the default ‪stylesheet of tabPane‬, I looked for the file ‎jfxrt‬.jar in my computer, and I open it in an archiver like WinRAR to get ‪‎caspian‬.css at com/sun/javafx/scene/control/skin/caspian.css. With this knowledge, I can easily see what could be there that causes the issue. caspian.css is also available online, here is the a link to the JavaFX 2.2 version.


我需要的是下面的代码:

.tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator {
     -fx-border-style: segments(0.166667em, 0.166667em);
     -fx-border-width: 1;
     -fx-border-color: -fx-focus-color;
}
我更改了颜色 -fx-focus-color: #0093ff;(所选选项卡中的蓝色)

关于css - 如何去除所选选项卡 Pane 中的蓝色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35260168/

相关文章:

html - 标题中的中心图像

css - 在 OpenSocial 小工具模块 XML 中包含远程 CSS 样式表的正确方法

3d - 如何在 JavaFX 8 中从 STL 创建 3D 形状?

java - 无法在 WinXP 32 位上为 JavaFX 应用程序构建 native 包

JavaFX TreeTableView 列 setOnEditCommit() 拒绝接受处理程序以保存已编辑的单元格

java - 在 JavaFX 上动态更新具有多个系列的条形图

JavaFX ControlsFX 自动完成 : How to get popup result into a new ObservableList

html - 被窃听的 Internet Explorer

ruby-on-rails - 如何在 wicked-pdf 中增加正常或给定的字体大小值

css - 漏洞?与 chrome 中的自定义字体对齐