title: JavaFX: Styling application with CSS Selectors
body: <p>I have a couple of questions about <strong>styling a JavaFX application with CSS Selectors</strong> (such as: <code>.table-view</code> for every <code>TableView</code>). </p>
  
  <p>I have created a main CSS-file, in which I want to define the universal style properties for my application. For example: every <code>TableView</code> gets the same color in every screen. I just import the <code>Main.css</code> in every .css that is associated with a .fxml file.</p>
  
  <p>Now I would like to style every <code>HBox</code> in a 'sidebar' the same way. I have tried it like this (as suggested in Oracle's documentation):</p>
  
  <pre><code>.sidebar &gt; .hbox {
      /* Just some styling */
  }
  </code></pre>
  
  <p>This is not working to my surprise, but the following pieces of code are working:</p>
  
  <pre><code>.sidebar &gt; HBox {
      /* Just some styling */
  }
  
  .sidebar HBox {
      /* Just some styling */
  }
  </code></pre>
  
  <p>Maybe it has something to do with the fact that <code>.sidebar</code> is a custom style, but I am not sure about this.</p>
  
  <p>So my questions are:</p>
  
  <p><strong>1. Why isn't the first one working?</strong></p>
  
  <p><strong>2. What should be the way to do this? (with <code>.hbox</code> or <code>HBox</code> and <code>&gt;</code> or nothing?)</strong></p>