最近做了javafx css样式美化工作,这里贴出成果跟大家分享一下,如果您觉得有帮助的话就顺手点个赞呗。
赠人玫瑰,手留余香。
/**
*Button通用样式
*/
.button:hover{
-fx-cursor: hand;
}
.button{
-fx-background-color: linear-gradient(to bottom,#7dc2fe,#004883);
-fx-font-size: 14px;
-fx-pref-width:64px;
-fx-pref-height: 28px;
-fx-text-alignment: center;
-fx-text-fill: #fff;
-fx-border-radius: 8px;
-fx-background-radius: 8px;
}
/**
*自定义Tab样式
*/
.mytab{
-fx-pref-width: 132px;
-fx-pref-height: 45px;
-fx-background-image: url('../../images/icon_1.png');
-fx-background-position: 20 12;
-fx-background-size: 15px;
-fx-background-repeat: no-repeat;
-fx-background-insets: 100%;
}
.mytab:hover{
-fx-background-image: url('../../images/icon_1on.png');
-fx-font-size: 16px;
}
.mytab:selected{
-fx-background-image: url('../../images/icon_1on.png');
-fx-font-size: 16px;
}
/**
*Tab通用样式
*/
.tab{
-fx-font-size: 14px;
-fx-background-color: white;
-fx-background-size: 15px;
-fx-background-repeat: no-repeat;
-fx-background-insets: 100%;
}
.tab:hover{
-fx-background-color: #1a83e1;
-fx-text-fill: white;
-fx-color : #1a83e1;
}
.tab:selected{
-fx-background-color: #1a83e1;
-fx-text-fill: white;
-fx-color : #1a83e1;
}
/**
*TabPane通用样式
*/
.tab-pane > .tab-header-area > .tab-header-background {
-fx-background-color: #EBF0FA;
-fx-text-fill: white;
}
.table-pane{
-fx-background-color: #fff;
}
AnchorPane{
-fx-background-color:white;
}
/**
*Lable通用样式
*/
.label{
-fx-font-size: 14px;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.youkuaiyun.com/qq_16055867/article/details/81036828