javafx - Jafa FX CSS Duplicates -
i new javafx , css styling , after clarification on optimal way following.
essentially, have 2 buttons have implemented hover , focus border color changes on both hover (mouse) , focused (key board tab). have following :
.normalbutton:hover { -fx-font-size: 11pt; -fx-font-family: "verdana"; -fx-font-weight : normal; -fx-background-color : #545454; -fx-border-color: #ffffff ; -fx-border-radius: 3,3,3,3; -fx-border-width: 1px ; } .normalbutton:focused { -fx-font-size: 11pt; -fx-font-family: "verdana"; -fx-font-weight : normal; -fx-background-color : #545454; -fx-border-color: #ffffff ; -fx-border-radius: 3,3,3,3; -fx-border-width: 1px ; }
it works fine wan wondering if there way combine both focused , hover have same properties.
multiple selectors can seperated ,
in css. if 1 of them matches, the style applied. in example this:
.normalbutton:hover, .normalbutton:focused { -fx-font-size: 11pt; -fx-font-family: "verdana"; -fx-font-weight : normal; -fx-background-color : #545454; -fx-border-color: #ffffff ; -fx-border-radius: 3,3,3,3; -fx-border-width: 1px ; }
Comments
Post a Comment