I need to add an image to title. I know how to do that in java code.
But I want to do that via css only.
I tried:
.titled-pane > .title{
-fx-graphic: url("imgs/general/logo.png");
}
and
.titled-pane {
-fx-graphic: url("imgs/general/logo.png");
}
But it did not help.
Update: Resources paths.
/src/main/resources/styles.css
/src/main/resources/imgs/general/logo.png
/src/main/resources/fxml/window.fxml
Try this -fx-background-image: url("")
Related
I'm trying to set the color of the background of the main header for the site cheswickwarriorsfutbol.com to #3f406d. I've used the following codes and they don't seem to be working.
.main-navigation {
color: #3f406d;
}
.hm-nav-container {
background-color: #3f406d;
}
.navigation-top {
background-color: #3f406d;
}
Can anybody help? Thank you
.mh-custom-header is the css selector you're looking for.
/* custom header */
.mh-custom-header {
background-color: #3f406d!important;
}
You were close.
Try this class instad:
.mh-header {
background-color: #e26060;
}
Along with that class, you may also want to affect the .mh-custom-header class with the same property
#Calvin Langer, your line of coding worked perfectly. Thank you! That was quick!
I have an issue with the backgroung of shop-image here is the LINK to shop page, and here is a screenshot
IMAGE
Here is the code that i tryed to change background :
div.page-title.page-title-default.title-size-default.color-scheme-light.title-design-centered.title-shop {
background-image:none;
background-color:#111111;
}
Add !important to background-image property, try this:
div.page-title.page-title-default.title-size-default.color-scheme-light.title-design-centered.title-shop {
/* important */
background-image:none !important;
background-color:#111111;
}
How could we change the progress bar colour in Primeng. In the progress bar documentation it lists down
ui-progressbar-value
as the Element whose width changes according to value.
But when in the CSS when I set
.ui-progressbar-value {
background-color: #ef5439;
}
It does not change anything. Infact I don't see any color.
Any help would be appreciated.
First add your own unique class in your progress bar like below
class="customProgress" and then try to override it in your scss or css file.
Hope it will work
<p-progressBar class="customProgress" [value]="value"></p-progressBar>
.customProgress .ui-progressbar .ui-progressbar-label {
color: yellow;
}
.customProgress .ui-progressbar .ui-progressbar-value {
background: red;
}
I achieved the result with the following configuration:
HTML
<p-progressBar [value]="progressValue"
[ngClass]="'customProgress'">
</p-progressBar>
In the CSS file, this is what you have to add:
::ng-deep .customProgress .ui-progressbar .ui-progressbar-value {
background: #ef5439;
}
The above solutions did not work for with primeng 11. I achieved the result in this way
`<p-progressBar [value]="progressValue" class="customProgress"></p-progressBar> `
and with theming property CSS
::ng-deep .customProgress .p-progressbar-label {
background: #ef5439;
color: #fff;
}
In angular prime ng components use below method of style to change progress bar color
<p-progressBar [style]="{'background':'red'}"></p-progressBar>
Yesterday I decided to try Polymer 1.0 and I'm already facing difficulties when trying to styling the paper-toolbar.
The documentation says that the background colour can be changed by using:
--paper-toolbar-background
But how can I use it on CSS?
I tried the following:
paper-toolbar {
--paper-toolbar-background: #e5e5e5;
}
Also this:
paper-toolbar {
--paper-toolbar {
background: #e5e5e5;
}
}
But neither worked. What is the correct way to do it?
Thanks.
If you are styling it on your main page, then you have to apply styles using <style is='custom-style'>. This is to make Custom CSS Properties work.
Applying is relatively easy. paper-toolbar provides 2 custom properties and one mixin. --paper-toolbar-background is a property that changes the background color of the toolbar while --paper-toolbar-color changes its foreground color. --paper-toolbar is a mixin applied to the toolbar.
To use these properties is just the same as applying styles in your elements. As an example
<style is="custom-style">
paper-toolbar {
--paper-toolbar-background: #00f; /* changes the background to blue*/
--paper-toolbar-color: #0f0; /* changes the foreground color to green */
--paper-toolbar: {
font-size: 40px; /* Change default font size */
}; /* Notice the semicolon here */
}
</style>
I couldn't find a solution to this problem either until recently. I have two toolbars and I didn't want to change the CSS for all toolbars just the header toolbar.
To change the CSS for every toolbar, in your external css file add the following:
paper-toolbar.paper-toolbar-0 {
background: orange;
color: red;
}
However, that doesn't address the problem. To change a single paper toolbar based on a class like the following:
<paper-toolbar class="header">
...
</paper-toolbar>
The above uses the class called "header" so in my CSS I added:
paper-toolbar.header {
background: orange;
color: red;
}
... and it worked! Yay! That means with this you should be able to override any CSS of any of the other elements doing the same thing. This is completely untested but I think it should work like:
<elementName>.<classname> {
...
}
Hope this all helps!
I'm using JavaFX, and in my CSS I have
.button:hover{
-fx-background-color: red;
}
Which works. But when I try to use another property,
.button:onMousePressed {
-fx-background-color: red;
}
Or onMouseEntered (which I expected to be the same behavior as hover), nothing happens. Is there something fundamentally different about how these work?
Those simply aren't valid CSS pseudoclasses for a button. You are probably looking for
.button:armed {
/* ... */
}
The valid pseudoclasses are listed in the CSS documentation