I'm trying to manipulate the font in Agenda from jfxtras (javafx).
I have a css file linked to it.
I figured out how to make it black and bold as well.
.AgendaText {
-fx-text-fill: BLACK;
-fx-font-weight: bold;
}
But I don't know how to change the font to say, Arial.
Thanks,
Browser will try to take first font, second font and if it wont be able to find it it will serve a sans serif system font
.AgendaText {
font-family: arial, helvetica, sans-serif
}
Related
I have developed my site using a theme (HTML, CSS, JavaScript).
But the Blog Title is using default link color.
I have tried many ways to use the Title color, but I became unsuccessful to do that.
How can I change the Title color?
Title color is disabled
Title is using Default link color
You can override the css properties using !important.
So, the following change might help:
.header-logo h1 {
color: #065445 !important;
font-size: 30px;
line-height: 1.4em;
}
Apply color property to "a" tag, not on h1. You can either use the following ways:
inline-CSS to impose this color to the title.
Use !important with color property of CSS.
.header-logo h1 a{
color: #065445 !important;
}
I've attempted adding a custom font to my program using CSS and i can't get it to work, is anyone able to help?
This is what i've got at the moment:
#font-face
{
font-family: walterturncoat;
src: url("../resources/fonts/walterturncoat.ttf");
}
.label
{
-fx-font-family: "Walter Turncoat";
-fx-text-fill: #ffffff;
-fx-font-size: 20pt;
-fx-effect: dropshadow(gaussian, #000000, 10, 0, 2, 2);
}
The url works as i used a similar path for an image (just /images/ instead of /fonts/) and i was able to get the font to work outside of CSS in the bulk of the program but i intend to be using it a lot so having it in CSS would be ideal.
I want to style the font of the CalendarTimeTextField Popup control using a CSS File.
The following entry doesn't work for me:
.CalendarTimeTextFieldSkin_popup {
-fx-text-fill: white;
-fx-font-style: italic;
}
Setting the font-type works, changing text color doesn't.
Thanks for supporting me
GGK
The text is rendered with a Text node (https://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#text) so use -fx-fill and/or -fx-stroke.
I specified a font in a style .css file:
-fx-background-color: #1e1c1e;
-fx-font-family: "Segoe UI", Helvetica, Arial, sans-serif;
but IDEA underlines the second line:
"mismatched property value null".
Then I tried to set a font in the following way:
inputField.setFont(Font.font("Segoe UI"));
All the same. Font won't change. I'd like to ask your help because I'm stucked with this issue.
Is it possible to add inline CSS code programmatically?
Like, I have defined a CSS separator like this:
.hr{
border-top: 1px solid black;
padding-bottom: 10px;
}
Now I sometimes want to have it in a different color or a different size.
Would I have to create further .hr-black, .hr-blue css styles and apply them separately by .addStyleName()? Or can I somehow set the color programmatically?
No, you can only change CSS at specific component using component.addStyleName(), but you can use it dynamically, like this:
if (condition)
component.addStyleName("black");
else
component.addStyleName("blue")