CSS Changing Logo Hover Color - css

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;
}

Related

Wordpress 5.7, Theme 2021. How to change the main menu submenu items to white

Wordpress 5.7, Theme 2021.
1 How do you change the colour of the submenu items in the Main Menu?
I'm a Wordpress newbie, basic/intermediate knowledge of CSS.
2 How do I change the background colour of the main menu and submenu?
This additional CSS makes the main menu items white. I want to do the same to the submenus.
*start of menu */
/*menu background */
.menu-wrapper {
background: rgba(204,153,51,.75);
}
a#primary-menu-list {
color:white;
}
.primary-navigation .primary-menu-container > ul > .menu-item > a
{color:white;}
.svg-icon
{color:white;}
/*end of menu */
As this theme supports CSS variables right now - I'd suggest you not override selectors, but override just variables. You need to add to your CSS these lines, replace with the colors you really want to use and make sure they override default styles
:root {
--primary-nav--color-link: #ffffff;
--primary-nav--color-link-hover: #cecece;
--primary-nav--color-text: #000000;
}
Here's the list of available variables for the main navigation
--primary-nav--font-family: var(--global--font-secondary);
--primary-nav--font-family-mobile: var(--global--font-primary);
--primary-nav--font-size: var(--global--font-size-md);
--primary-nav--font-size-sub-menu: var(--global--font-size-xs);
--primary-nav--font-size-mobile: var(--global--font-size-sm);
--primary-nav--font-size-sub-menu-mobile: var(--global--font-size-sm);
--primary-nav--font-size-button: var(--global--font-size-xs);
--primary-nav--font-style: normal;
--primary-nav--font-style-sub-menu-mobile: normal;
--primary-nav--font-weight: normal;
--primary-nav--font-weight-button: 500;
--primary-nav--color-link: var(--global--color-primary);
--primary-nav--color-link-hover: var(--global--color-primary-hover);
--primary-nav--color-text: var(--global--color-primary);
--primary-nav--padding: calc(0.66 * var(--global--spacing-unit));
--primary-nav--border-color: var(--global--color-primary);
Attempt 1:
I failed with the CSS, but then looked carefully in:
Plugin: Options for Twenty Twenty-One (free version)
Customising Nav Options
set Nav Background Color: selected the relevant color
Attempt 2:
Without the plugin
This works well when I use the + key to trigger the drop down
If I click on the submenu heading the heading is hard to read (white text on whitish background).
Additional CSS
:root {
/*submenu color */
--primary-nav--color-link: white;
/*main menu color */
--primary-nav--color-link-hover: white;
/* where does this take effect?
--primary-nav--color-text: red;
*/
--primary-nav--color-text: #000000;
}
/*this is the background of the main menu only, not submenu */
.menu-wrapper {
background: rgba(204,153,51,.75);
}
/*
this is for the submenu (drop down menus)
*/
.primary-navigation .sub-menu .menu-item>a { color: var(--primary-nav--color-link);
background:rgba(204,153,51,.75); */
}
.svg-icon
{color:white;}

CSS of nested selector is not being applied to div

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 */
}
}

How to apply CSS only on certain anchors

I've a website with 3 pages.
https://mywebsite.com/#
https://mywebsite.com/#features
https://mywebsite.com/#download
I want to change the some of the CSS based on which anchor I'm at.
Here's an example of what I'm trying to do, what I get and what I expect.
#header-outer #social-in-menu a i::before{
color: #000000;
}
This does change social button colors to black but on every anchor. I've tried to wrap it with a[href*="features"] so that it would only change in #features link but social icons remains white.
This is what I tried to achieve show social icons black only in #features anchor.
a[href*="features"] {
#header-outer #social-in-menu a i::before{
color: #000000;
}
}
This one has no effect. Changes nothing. First part of CSS however does change icons to black but on all anchors.
How can I achieve this?
What I try to have as the end result is:
a[href*="features"] {
#header-outer #social-in-menu a i::before{
color: #000000; /* could be a different colour */
}
}
a[href*="download"] {
#header-outer #social-in-menu a i::before{
color: #FFFFFF; /* could be a different colour */
}
}
You can do something like:
$(document).ready(function() {
$(document).on("click", "a", function(e) {
var id = $(this).attr("href").substring(1);
$(".parent").attr("id", id);
});
});
a {
color: black;
}
#features a {
color: red;
}
#download a {
color: blue;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="parent">
Home
Features
Download
</div>
What this does is basically update the id of the parent element that wraps your anchors. This solution doesn't use :target and involves the use of Javascript/Jquery.

Does wkhtmltopdf respect css font color?

I'm using wkhtmltopdf to generate a pdf of a page but it doesn't display any of the fonts in the correct colour, they all are presented black.
The colour is defined as you'd expect:
.panel-dashboard p.stat {
color: #bed000;
}
and displays correctly when viewed in the browser.
I'm calling it as
wkhtmltopdf path/to/page filename
Does wkhtmltopdf just not render font colours correctly? I've not been able to find any issues relating to this.
Appears this was a problem with wkhtmltopdf 0.9.9, 0.11 renders css font colors correctly.
Using version 0.12.2.4 specifying a white font inside the CSS (inside a grey background) worked, but a colored font (red, orange) did not:
.header { background-color: #888; color: #fff; } /* works */
.orange { color: f80; } /* doesn't work in wkhtmltopdf */
Using a style directly on the div did work:
<div style="color:#f60;">My Orange Text</div>
It may be because there is no background?? I don't know.
So if you try CSS and it fails this may work...
You are probably using this proposed CSS which has defined #media print { * { color: black !important; } }
Using version 0.12.6 here. Results look like following:
[pandoc.css] #media print { * { color: black !important; } }
[my.css] TODO2 { color: #700 !important; }
TODO3 { color: #700; }
[file.md] <TODO1 style="color: #700 !important;">black</TODO1>
<TODO1 style="color: #700;"> black</TODO1>
<TODO2> red</TODO2>
<TODO3> black</TODO3>
and
[pandoc.css] #media print { * { color: black; /* not important */ } }
/* or not using proposed pandoc.css at all */
[my.css] TODO2 { color: #700 !important; }
TODO3 { color: #700; }
[file.md] <TODO1 style="color: #700 !important;">red</TODO1>
<TODO1 style="color: #700;"> red</TODO1>
<TODO2> red</TODO2>
<TODO3> red</TODO3>

Button CSS weird results

I've been working on positioning a button for a web app and ran into some difficulty.I've created this jsfiddle, which demonstrates the problem.
The code is taken out of context, so some of the rules and classes and such may not make sense, but the problem I'm having is the same. The button moves away on click and I can't seem to fix it when playing with the position. I want the button to stay in the same place when clicked, so that clicking on the button will actually take you to the link that it is referencing.
Any Ideas?
Thanks.
You are specifying the link move to 1px from the top of the page in the rule .back:active (what happens when you click down on an item.)
http://jsfiddle.net/3dk48/8/
a.back:active {
/* This breaks it.
position: inherit;
top:1px; */
color: black;
}
In addition, if you want to still have :active effects, you need to have the correct specificity (currently a.back:link rule overrides your color for :active, but if you correctly update the specificity you can fix that. As well as link rule positioning in the LV(f)HA order (LoVe HAte mnemonic, plus focus lol) will ensure your pseudoclasses work properly.)
The LoVe-f-HAte mnemonic:
a:link { ... }
a:visited { ... }
a:focus { ... }
a:hover { ... }
a:active { ... }
... ensures that the correct states override the correct other states.
Remove the below code from .back style
position: absolute; // not need
margin-left: 2%; // not need
then the problem can solved.
EDIT:
also make change here..
.back:active {
/* position: absolute;
top: 1px; */
color: black;
}
fiddle: http://jsfiddle.net/3dk48/9/
use this:
.back{
top:32px !important;
}
body{
position:relative;
}

Resources