2015-09-04 66 views
2

我一直在調整CSS幾個小時,我已經放棄了。我無法弄清楚如何刪除我的標籤頂部的間距。請幫忙!JavaFX無法刪除標籤頂部的空間

enter image description here

CSS:

.tab-pane { 
    -fx-tab-min-height: 3em; 
    /* 24 */ 

    -fx-tab-max-height: 3em; 
    /* 24 */ 
} 
.tab .tab-label { 
    -fx-background-color: transparent; 
    -fx-alignment: CENTER; 
    -fx-text-fill: #EBEAF0; 
} 
.tab { 
    -fx-background-insets: 0.0; 
    -fx-background-radius: 0.0; 
    -fx-background-color: #17181B; 
} 
.tab:selected { 
    -fx-background-color: #21477A; 
} 
.tab:focused { 
    -fx-focus-color: transparent; 
} 
.tab { 
    -fx-padding: 0 30 0 30; 
} 
.tab-pane *.tab-header-background { 
    -fx-background-color: #17181B; 
} 
.tab-pane:top *.tab-header-area { 
    -fx-background-insets: 0, 0 0 1 0; 
    -fx-padding: 0.416667em 0.166667em 0.0em 0.0em; 
} 
.tab:selected .focus-indicator { 
    -fx-focus-color: transparent; 
    -fx-border-color: transparent; 
} 

有人能告訴我如何刪除空間的那一點點在設置選項卡的頂部?謝謝!

+0

我可以看到'padding'的設置,但沒有'margin',可能是出了什麼問題? – Phantomazi

+0

這些問題與JavaFX的默認設置有關。默認情況下,它們會在側面和頂部添加間距。 –

+0

您可能希望使用[ScenicView](http://fxexperience.com/scenic-view/)來調試佈局。 – jewelsea

回答

3

對我來說改變

-fx-padding: 0.416667em 0.166667em 0.0em 0.0em; 

-fx-padding: 0.0em 0.166667em 0.0em 0.0em; 

.tab-pane:top *.tab-header-area發揮預期。

+0

真棒非常感謝你! –