1 Reply Latest reply: Jun 20, 2014 9:48 AM by David Grieve RSS

    Prevent CSS inheritance

    2698391

      Dear all,

       

      I have a SplitPane, which is inside another SplitPane in the same tree hierarchy of the Scene.

      When I set the CSS class of the outer SplitPane, it always overwrites all CSS Settings of the inner one. How can I prevent it, so that e.g. I can assign a red divider for the outer and a green one for the inner SplitPane.

       

      I have defined the CSS with

      <code> </code>

        • 1. Re: Prevent CSS inheritance
          David Grieve

          Add a style-class to your SplitPane's:

           

              SplitPane outer = new SplitPane();

              outer.getStyleClass().add("outer");

              SplitPane inner = new SplitPane();

              inner.getStyleClass().add("inner");

           

          Then use those style-classes in a .css file:

          .split-pane.outer { ... }

          .split-pane.inner { ... }