首先来看下javafx css是什么东西:官网的解释
JavaFX Cascading Style Sheets (CSS) is based on the W3C CSS version 2.1 [1] with some additions from current work on version 3 [2]. JavaFX CSS also has some extensions to CSS in support of specific JavaFX features. The goal for JavaFX CSS is to allow web developers already familiar with CSS for HTML to use CSS to customize and develop themes for JavaFX controls and scene graph objects in a natural way. The JavaFX CSS support and extensions have been designed to allow JavaFX CSS style sheets to be parsed cleanly by any compliant CSS parser, even though it might not support JavaFX extensions. This enables the mixing of CSS styles for JavaFX and for other purposes (such as for HTML pages) into a single style sheet. To this end, all JavaFX property names have been prefixed with a vendor extension of "-fx-". Even properties that might seem to be compatible with standard HTML CSS have been prefixed, because JavaFX has somewhat different semantics for their values.
就是说你原来写网站app的那套css不适用。
不能用width,height,float
在我实际的优化当中,我是用padding来设置的
至于块元素的位置 我让java开发人员用坐标设置,前端无能为力。
前端块状元素他是直接给你弄好了。
来看下
Accordion Button ButtonBase Cell CheckBox CheckMenuItem ChoiceBox ColorPicker ComboBox Control Hyperlink IndexedCell Label Labeled ListCell ListView Menu MenuBar MenuButton MenuItem MenuItemBase Pagination PasswordField ProgressBar ProgressIndicator RadioButton RadioMenuItem ScrollBar ScrollPane Separator Slider SplitMenuButton SplitPane TabPane TableView TextArea TextInputControl TextField TitledPane ToggleButton ToolBar Tooltip TreeCell TreeView
他的样式设置方式有fx定义的,其实就是封装的。
javafx css有集成了css3 / css2 但是css3的动画属性一个都不支持
有一个属性就是
box-shadow