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

https://www.w3.org/tr/css21/selector.html#grouping


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -