LucaMs Expert Licensed User Longtime User Feb 7, 2014 #1 I read something about CSS listlessly few thousand years ago, so I only know their purpose. Now, to use B4J, they are practically necessary. I suppose JavaFX CSS is an implementation of CSS, since I found a small utility that creates CSS code but this code does not work when copied as it is. Forgive my verbosity: how can I get the bold, for example? From this guide: JavaFX CSS Reference Guide: <font-weight> The font's weight, using the following syntax: [ normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 ] ... -fx-font-size <font-size> inherit -fx-font-weight <font-weight> inherit I tried using both: Code: Copy mlblTitle.Style = "-fx-font-weight:bold" Code: Copy mlblTitle.Style = "-fx-font-weight: bold" they do not work (but Code: Copy mlblTitle.Style = "-fx-font-size:18" works fine) How should I behave, generally in B4J, with CSS? Thank you in advance Last edited: Feb 7, 2014
I read something about CSS listlessly few thousand years ago, so I only know their purpose. Now, to use B4J, they are practically necessary. I suppose JavaFX CSS is an implementation of CSS, since I found a small utility that creates CSS code but this code does not work when copied as it is. Forgive my verbosity: how can I get the bold, for example? From this guide: JavaFX CSS Reference Guide: <font-weight> The font's weight, using the following syntax: [ normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 ] ... -fx-font-size <font-size> inherit -fx-font-weight <font-weight> inherit I tried using both: Code: Copy mlblTitle.Style = "-fx-font-weight:bold" Code: Copy mlblTitle.Style = "-fx-font-weight: bold" they do not work (but Code: Copy mlblTitle.Style = "-fx-font-size:18" works fine) How should I behave, generally in B4J, with CSS? Thank you in advance
stevel05 Expert Licensed User Longtime User Feb 7, 2014 #2 Code: Copy mlblTitle.Style="-fx-font-weight:bold;" works for me with or without the trailing ';' if you are adding more than 1 style using the style method, they need to be added at the same time, or only the last one will take effect i.e. Code: Copy mlblTitle.Style="-fx-font-weight:bold;-fx-font-size:18;" Upvote 0
Code: Copy mlblTitle.Style="-fx-font-weight:bold;" works for me with or without the trailing ';' if you are adding more than 1 style using the style method, they need to be added at the same time, or only the last one will take effect i.e. Code: Copy mlblTitle.Style="-fx-font-weight:bold;-fx-font-size:18;"
Erel B4X founder Staff member Licensed User Longtime User Feb 7, 2014 #3 It is easier and more powerful to use an external sheet: Using external CSS file to style a ToggleButton Upvote 0
It is easier and more powerful to use an external sheet: Using external CSS file to style a ToggleButton
LucaMs Expert Licensed User Longtime User Feb 7, 2014 #4 Many thanks. Yes, my intention is to use external files, but creating them "manually" ... I might end up in a mental hospital! I will try again using some tools. Thanks again Upvote 0
Many thanks. Yes, my intention is to use external files, but creating them "manually" ... I might end up in a mental hospital! I will try again using some tools. Thanks again