javafx css 魔法玩轉

來源:互聯網
上載者:User

標籤:

首先來看下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開發人員用座標設定,前端無能為力。

前端塊狀元素他是直接給你弄好了。

來看下

AccordionButtonButtonBaseCellCheckBoxCheckMenuItemChoiceBoxColorPickerComboBoxControlHyperlinkIndexedCellLabelLabeledListCellListViewMenuMenuBarMenuButtonMenuItemMenuItemBasePaginationPasswordFieldProgressBarProgressIndicatorRadioButtonRadioMenuItemScrollBarScrollPaneSeparatorSliderSplitMenuButtonSplitPaneTabPaneTableViewTextAreaTextInputControlTextFieldTitledPaneToggleButtonToolBarTooltipTreeCellTreeView

  他的樣式設定方式有fx定義的,其實就是封裝的。

javafx css有整合了css3 / css2 但是css3的動畫屬性一個都不支援

 

有一個屬性就是

box-shadow

 

javafx css 魔法玩轉

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.