【问题标题】:how to set border spacing in javafx如何在javafx中设置边框间距
【发布时间】:2015-12-30 17:26:41
【问题描述】:

如何在javafx中使用边框间距属性

就像在 css for html 中一样

table.ex1 {
    border-collapse: separate;
    border-spacing: 10px 50px;
}

如何在 javafx 中使用边框间距?

在 TabPane 中,我想在每个选项卡下放置一个底部边框,而我的 css 是

.tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator {
    -fx-border-width: 4px;
    -fx-border-color: transparent transparent white transparent;


}

它的工作原理,我有很好的底部边框,但我需要更多的边框间距,所以有人请告诉我该怎么做?

提前致谢。

【问题讨论】:

  • 你能解释一下吗,“但我需要更多的边框间距”..

标签: css javafx border-spacing


【解决方案1】:
.tab:top{
-fx-background-color: transparent;
-fx-border-insets: 0 0 0 0;
-fx-border-color: white white white white ; 
-fx-padding: 15px;
}

我认为 javafx css 中没有边框间距类型属性,但无论如何你可以在 TabPane 中通过选项卡的 -fx-padding 属性来实现。

【讨论】:

    【解决方案2】:

    添加一些-fx-border-insets。类似的东西

    .tab-pane:focused > .tab-header-area > .headers-region > .tab:selected .focus-indicator {
        -fx-border-width: 4px, 0px;
        -fx-border-color: transparent transparent white transparent, transparent;
        -fx-border-insets: 0px 0px 2px 0px, 0px 0px 4px 0px ;
    
    }
    

    查看CSS documentation for Region了解详情。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-10-25
      • 1970-01-01
      • 2019-07-11
      • 2020-11-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-19
      相关资源
      最近更新 更多