Could it just be as simple as a misspelling? The psuedo-class I believe you are looking for is :focus
not :focused
. See here: https://developer.mozilla.org/en-US/docs/Web/CSS/:focus
I have never heard of :focused
.
EDIT: Apparently I was wrong and it actually is spelled differently in JavaFX CSS. Disregard above.
That being said, I did not really understand what you are trying to do because your description was not written very clearly. If my above suggestion doesn't work I would be happy to help you work it out but I would need you to make your question more clear.
Beyond that, if the snippet you included contains the actual styles and ID names, I have just a couple small suggestions for you.
1. l1
is a really bad name for a selector. On top of being unsemantic and not giving you or future developers any indication of what it actually is, it also falls into the problem of the l
and 1
characters looking very similar. This invites confusion with some many different fonts. Semantic selector names are a best practice. You can read more about good CSS naming conventions in this guide here: https://cssguidelin.es/#naming-conventions
2. From a UI perspective, underlines tend to indicate to people that what is being underlined is a link. Underlining an element heading like you did with "User Login" is somewhat visually unappealing and also misleading to users. See the "Do's and Don'ts" in the WPF UI Guidelines here: https://cdn.wfp.org/guides/ui/v0.14.0/basics/typography/ Or the Nielsen Norman Group's Guidelines for Visualizing Links here: https://www.nngroup.com/articles/guidelines-for-visualizing-links/