I am trying to apply a CSS file to a JavaFX WebView object. From what I\'ve read, this should do the trick, but evidently I\'m missing something because the WebView display
James_D already explained in his answer how to convert "JavaFx CSS" to "HTML CSS", but it may be more convenient to use WebEngine.setUserStylesheetLocation to set a stylesheet that contains the CSS:
webEngine.setUserStyleSheetLocation(getClass().getResource("style.css").toString());
style.css contains the css code:
body {
background-color: #00ff80;
font-family: Arial, Helvetica, sans-serif;
}