Beginner question. I have this code, which works fine
/* Start attribute labels bold */
.custom-attributes .attribute-label {
font-weight: bold;
}
/*End attribute labels bold */
/* Start attribute value color */
.custom-attributes .attribute-value {
color: red;
}
/* End attribute value color */
Now, I'd like to filter the .custom-attributes .attribute-label and look for the value 1, then print all the .custom-attributes .attribute-value to this label green. So basically
I hope this is understandable... How can I do this?
This is for a wordpress website to customise the output on the website.
Related
I utilised the BEM method and my <div> is showing the css from the Block and Modifier, but not the Element
i.e. the css for c-banner(block) and --warning(modifier) is appearing but not __icon(element).
I know that the color of the modifier is appearing because I tried changing it to another color and it appears on the UI.
Eg:
Currently:
&--warning {
color: #D9822B
}
Edited:
&--warning {
color: black
}
Once changed, the icon of --warning will show up with a black color on the UI.
However, the padding-right of __icon doesn't ever get applied.
c-banner {
/* Block CSS Properties */
&__icon {
padding-right: 12px;
&--warning { /* Used for warning purposes */
color: #D9822B;
}
&--primary { /* Used for general information */
color: #137CBD;
}
&--success { /* Used for verified access */
color: #0F9960;
}
&--danger { /* Used as a hard stop */
color: #DB3737;
}
}
}
I'm genuinely perplexed as to why the padding-right of __icon does not get applied but the color of --warning is
All you are missing is:
.c-banner ..... the dot before the classname
Also, for padding to work they have to be inside --warning because you are chaining to form the full selector and there is no selector that ends with __icon
You can style material-icons if you want to affect multiple:
.c-banner {
.material-icons { padding-right: 12px; }
/* can also do [class*="__icon"] but may be less predictable */
&__icon {
/* rest of the scss */
}
}
I want to apply a background color but not bold the paper-item when its selected. I notice the weight property does not do anything ...
paper-item {
--paper-item-selected-weight: normal; /* its still bold */
--paper-item-selected: {
background: #3f9c35; /* no issues here */
}
}
The HTML
<paper-menu selected="0">
<paper-item>TEST</paper-item>
The same happens if I use paper-icon-item
I've managed to change the Logo the way I want it using Logo using CSS but I'm struggling to figure out how to change the hover color of it.
I want to change the TEST color on hover from blue to something else
http://test.peterstavrou.com/
At the moment my CSS code is
header#top #logo {
letter-spacing: 2px;
font-size: 35px;
}
your Logo-Text is a link so you should use css-syntax for styling links:
a#logo:link { color: #fff; } /* a Link that has not been clicked yet */
a#logo:visited { color: #fff; } /* a link that has been clicked before */
a#logo:hover { color: #ff0; } /* a link on hover/rollover */
a#logo:active { color: #ff0; } /* a link that is just clicked */
Just do something like:
Solutions 1 Find the logo hover css and change the color property value to whatever color you want
color: red!important; /* change the property value to the color you want */
Solution 2 Create another hover CSS and force a change as shown below, if the above doesn't work
#logo:hover {
color: red!important;
}
Note: Make sure the code above is at the very bottom of your css file. that way, it will override the previous hover property defined, even if it has important
Add this below the code for header#top #logo { ... } that your sample is showing in the CSS.
header#top #logo:hover
{
color:red;
}
I want to change the color or even disable totally the alternating background colors in google prettify wich I use at my blog#blogger.
My current CSS is Doxy theme with this change:
/* Specify class=linenums on a pre to get line numbering; line numbers themselves are the same color as punctuation */
ol.linenums { margin-top: 0; margin-bottom: 0; color: #8B8970; } /* IE indents via margin-left */
li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: decimal !important }
/* Alternate shading for lines */
li.L1,li.L3,li.L5,li.L7,li.L9 { }
This is how it looks now
I would like to change this white color to a dark grey with transparency or even completely remove the alternating color.
I've tried removing this
/* Alternate shading for lines */
li.L1,li.L3,li.L5,li.L7,li.L9 { }
But still nothing..
Succeeded in fixing this by using the background property at the
/* Alternate shading for lines */
li.L1,li.L3,li.L5,li.L7,li.L9 { }
and also using the !important keyword to overwrite the defaults.
So this is how it looks like:
/* Alternate shading for lines */
li.L1,li.L3,li.L5,li.L7,li.L9 { background: #color !important }
I'm trying to update a website. There's a label element I want to style. It looks like:
#foo {
font-size: 9px;
}
<label id="foo"></label>
but it looks like a css definition for the "label" element is overriding the more specific style I'm setting. I'm seeing this in firebug
label {
font-size: 16px;
}
.foo {
font-size: 9px; /* strikethrough on my font-size declaration here */
}
so is there a way to override the default label font-size setting without modifying it for everything? (I thought my more specific definition would do that by default)
Thanks
You've mixed up the syntax for id with the one for class:
#foo { /* # = id, . = class */
font-size: 9px;
}
Keep in mind that ids are supposed to be unique for the entire document
or switch your label to using a class instead:
<label class="foo"></label>
You could always use the !important indicator to give precedence to the rule.
font-size: 9px !important;