如何删除 JavaFX TabPane 上的边框?

发布于 2025-01-13 05:44:10 字数 727 浏览 1 评论 0原文

我有 tabpane javafxcss 样式:

.tab {
-fx-background-color:  #002f6c;
}

.tab-pane>*.tab-header-area>*.tab-header-background
{
-fx-background-color: -fx-outer-border, -fx-text-box-border, #002f6c;
}

.tab:selected {
-fx-background-color:  #0041a0;
}
.tab-label {
-fx-text-fill: #ffffff;
}

.tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator 
{
-fx-border-radius: 0px;
-fx-border-width: 0px 0px 0px 0px;
-fx-border-color: #4d1a4dff;
}

但我仍然无法摆脱选项卡附近的白色边框: 输入图片此处描述

有人可以帮我吗?

I have this css styling for tabpane javafx:

.tab {
-fx-background-color:  #002f6c;
}

.tab-pane>*.tab-header-area>*.tab-header-background
{
-fx-background-color: -fx-outer-border, -fx-text-box-border, #002f6c;
}

.tab:selected {
-fx-background-color:  #0041a0;
}
.tab-label {
-fx-text-fill: #ffffff;
}

.tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator 
{
-fx-border-radius: 0px;
-fx-border-width: 0px 0px 0px 0px;
-fx-border-color: #4d1a4dff;
}

But i still can't rid of this white border near my tabs:
enter image description here

Can somebody help me with it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白首有我共你 2025-01-20 05:44:10

白色边框效果是由于 .tab-header-background 上应用了背景颜色插图。修改下面的代码应该可以解决问题。

.tab-pane>*.tab-header-area>*.tab-header-background {
  -fx-background-color: #002f6c;
  -fx-background-insets:0;
}

The white border effect is because of the background color insets applied on .tab-header-background. Modifiying the code below should do the trick.

.tab-pane>*.tab-header-area>*.tab-header-background {
  -fx-background-color: #002f6c;
  -fx-background-insets:0;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文