Addm1X
Addm1X

Reputation: 27

How to remove border on JavaFX TabPane?

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?

Upvotes: 0

Views: 406

Answers (1)

Sai Dandem
Sai Dandem

Reputation: 9879

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;
}

Upvotes: 1

Related Questions