Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set multiple styleClass values

Tags:

How does one set two classes on a node in a JavaFX FXML file?

<VBox styleClass="notice high">

This adds one value "notice high" instead of two values "notice" and "high". How can I add two values?

like image 256
John Kugelman Avatar asked Aug 29 '14 03:08

John Kugelman


People also ask

How do I style elements with two classes in CSS?

Styling element containing both classes: The element containing both of the classes will be styled only. All the other elements containing either one or zero of the two classes will not be styled. Note: In CSS selector, there is no space between the class names.

How to apply multiple CSS styles in jQuery?

Select an element by id with DOM API and apply the setAttribute with the style attribute. It is easy to apply multiple CSS styles in jquery. CSS styles can also be applied using the selector attribute. Html element is applied styles using element selector (elementname), class selector (.selector) and id selector (#selector) syntax.

How do I define multiple classes in CSS?

To define multiple classes, separate the class names with a space, e.g. <div class="city main">. The element will be styled according to all the classes specified. In the following example, the first <h2> element belongs to both the city class and also to the main class, and will get the CSS styles from both of the classes:

How do I style a class individually?

Note: The names of the classes must be space-separated. Then the classes can be either styled individually using “ .class_1 ” and “ .class_2 ” or that element could be styled only that contains both of the classes using “ .class_1.class_2 “. Styling Individually: Both of the classes in the following example are styled individually.


1 Answers

"Primitive type" lists can be seperated by ',' inside an attribute

<VBox xmlns:fx="http://javafx.com/fxml/1" styleClass="a, b">
like image 58
tomsontom Avatar answered Sep 19 '22 23:09

tomsontom