The properties grouped together to create a new style in the CSS represents a style rule. Sometimes a style needs to be applied to multiply node types. For example, you might want to style all text in the same font family. This includes all Text nodes, labels, button text, etc. For this type of style we can use a style rule. We can setup the CSS to allow for multiple nodes to have the same property.
- [Voiceover] When working with Cascading Style Sheets…usually, they have more than one property…that you want to group together as a new style.…When you group these properties together,…you create a style rule.…Sometimes, styles need to be applied to multiple nodes.…For example, maybe you want to…set the font for all the text in the scene.…There could be text on a button,…there could be a text field,…there could be text on a label.…So, you might want to group them together…so they all have the same font family…and the same font size.…
It is also possible to have a style rule…that has a pattern that is used…to traverse the scene graph hierarchy of nodes.…From the root node to the child nodes.…For example, maybe we only want to style…the buttons together that are inside of a horizontal box,…but all other buttons might have a different rule.…Let's take a look at some CSS style rules.…I already have a program here…that creates two buttons and both buttons have text.…Let's take a look at the program before I add any style.…
- What is JavaFX?
- Creating a simple JavaFX program
- Drawing lines, shapes, and text
- Applying effects
- Adding and animating images and charts
- Customizing interfaces with CSS
Skill Level Intermediate
1. Get Started with JavaFX
2. Sample Applications
4. User Interface Components
6. Custom UIs
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.