Introduction to JavaFX CSS

What is CSS?

Cascading Style Sheets also referred to as CSS, is a simple design language intended to simplify the process of making web pages presentable.
CSS handles the look and feel part of a web page. Using CSS, you can control the color of the text, style of fonts, the spacing between paragraphs, size of columns and layout. Apart from these, you can also control the background images or colors that are used, layout designs, variations in the display for different devices and screen sizes as well as a variety of other effects.

Here is an CSS Syntax -:
 selector { property: value }

In above Syntax, 

Selector − A selector is an HTML tag at which a style will be applied. This could be button, label, tab-pane, etc

Property − A property is a type of attribute of the HTML tag. In simpler terms, all the HTML attributes are converted into CSS properties. They could be color, border, etc.

Value − Values are assigned to properties. For example, a color property can have value either red or #F3F3F3, etc.

Here is an Example of above Syntax,

.button{

   -fx-background-color:#333;
   -fx-text-fill:#fff;

}

In above example,

Selector  -   button
Property  -  -fx-background-color
Value      -   #333

So this is a small introduction about JavaFX CSS 😊

-Happy Coding

Comments

Popular posts from this blog

How to write JavaFX CSS for tab pane

How to add JavaFX CSS in your SceneBuilder

Basic of JavaFX CSS Syntax