Remove insets in JavaFX TitledPane with CSS not working

帅比萌擦擦* 提交于 2019-12-05 12:55:42

Set the -fx-padding to 0 on the following style classes.

.titled-pane .content AnchorPane {
    -fx-padding: 0px;
}

To extend @NDY's answer:

If you do not use AnchorPane as the TitledPane's content, but some other node, you have to adjust the CSS accordingly.

An universal CSS solution for removing padding on a TitledPane's content, no matter which type of Node is used as content, is the following:

.titled-pane > .content > * {
    -fx-padding: 0px;
}

This sets the padding for any child of the TitledPane's content to 0px.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!