I'm a beginner dev and I have a class assignment which is making a WordPress site using a child theme customization (PHP/CSS/JS).
Here is the issue : for some reason that I've ignored, VS code is not recognizing the classes I use and they are the same ones that were working just fine before.
Here is the issue, you can tell some classes are in white instead of orange
.wp-block-button a:hover {
background: linear-gradient(#7864f4, #00aeef);
color: #fff;
border-color: linear-gradient(#7864f4, #00aeef;
}
.wp-block-button a:hover:before {
height: 200%;
}
/* end block button*/
/* menu hover */
.nav li:hover {
color: #00aeef;
}
.navbar-nav li:hover {
color: #00aeef;
}
If anyone has a solution for this it would be greatly appreciated.
In Visual Studio Code, click View then Problems for a list of problems in your source code. A web search for those problems will help solve much more significant errors.
The community has mixed feelings about homework questions.
We can show we value their time and help by describing our efforts to solve the problems ourselves. Example: "I googled VS Code double-red underline."
Line 4 of screenshot has a double-red underline indicating the spot of the syntax error:
border-color: linear-gradient(#7864f4, #00aeef;
=
There is a missing closing parenthesis character ):
border-color: linear-gradient(#7864f4, #00aeef);
=
Balancing parenthesis and other special syntax characters is one of the most common syntax errors across scripting and programming languages, you'll get used to watching for it.
For most IDE's like VS Code:
When your cursor is on a parenthesis, most editors will also indicate the matching parenthesis.
Highlight warnings and errors via underlining, highlighting, or other visual indications.
In this case, there should also be a red line in the code minimap, and a red dot on the scroll bar.
You're missing a bracket on the fourth line. CSS requires you to have opening and closing brackets in these types of instances.
The code below should fix it:
.wp-block-button a:hover {
background: linear-gradient(#7864f4, #00aeef);
color: #fff;
border-color: linear-gradient(#7864f4, #00aeef);
}
.wp-block-button a:hover:before {
height: 200%;
}
/* end block button*/
/* menu hover */
.nav li:hover {
color: #00aeef;
}
.navbar-nav li:hover {
color: #00aeef;
}
Related
I want to modify the color and the border in a Bootstrap nav bar but when I write this on my SCSS nothing happens:
.nav-link.active {
color: #495057;
background-color: chartreuse;
border-color: black;
}
When I inspect the element in Chrome my code is dismissed, It only takes into account the Bootstrap default style.
Image
Any help will be welcomed.
Thanks.
For a CSS rule to be overriden, you have a lot of options. The cleanest would be to be more specific (by at least one rule) than the one you want to override.
If I follow your example:
.nav-tabs li.nav-link.active {
color: #495057;
background-color: chartreuse;
border-color: black;
}
You'll find more informations here : https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
I have been asked to theme my APEX 19.2 app and the designer has come back with a fairly simple ask. The top left hamburger be white and purple like below:
I am using the theme roller to apply the settings and can't seem to get the active and inactive state to stay white and purple.
I have even tried my own CSS in the theme roller like below but only with limited success.
Any ideas how I can achieve this?
CSS I am currently trying
t-Button--icon {
color: #393093!important;
background: #ffffff!important;
border-color: #393093!important;
}
t-Button--header {
color: #393093!important;
background: #ffffff!important;
border-color: #393093!important;
}
t-Button--headerTree {
color: #393093!important;
background: #ffffff!important;
border-color: #393093!important;
}
t-Header-controls {
color: #393093!important;
background: #ffffff!important;
border-color: #393093!important;
}
is-active {
color: #393093!important;
background: #ffffff!important;
border-color: #393093!important;
}
NavigationBar {
color: #393093!important;
background: #ffffff!important;
border-color: #393093!important;
}
Even with all of this my button active and hover still looks like this:
I feel like I am close but after several hours of fiddling, I thought it was about time I consult the collective experts. Any help and advice would be greatly appreciated. If you can't already tell I am still learning CSS.
You ought to use the CSS :hover selector which is used to select elements when one mouses over them.
Assuming the hamburguer menu has a class named burguer
.burguer:hover {
color: #393093;
background: #ffffff;
border-color: #393093;
}
Then change the hover and active effects :)
.burguer:hover {}
.burguer:active {}
It might be worth checking if Apex does not use a selector that has "higher ponctuation" than something so simple. In such case, you might want to create a composite selector
button.t-Button--header .burguer:hover{}
Good Luck
I've added some custom CSS code to a Wordpress.com theme to alter link formatting. (I'm a beginner, but I attempted to research this and found some code that looked reasonable.)
Chrome is getting it about 90% right and FF about 10% right. Is this inevitable and I should revert to theme defaults, or is there something I can do differently to make this change work in common browsers?
To be more specific, "border: none" is working in both browsers, but the custom color for the link is usually missing in FF--which means no one but me can tell it's a link. Even in Chrome it's only usually the right color. And, the color I set for "active" isn't displaying at all. Meanwhile, the block quote change is rendering in both browsers.
All I added was this CSS (added in the edit window they provide which by definition means it's at the end of the total CSS for the page, so that should make it override or inherit, I thought).
div.entry-content a:link {
color: #2C60BA;
text-decoration: none;
border: none;
}
div.entry-content a:active {
color: #3A93BC;
text-decoration: none;
border: none;
}
blockquote {
float: none;
width: 24em;
margin-left: 2em;
}
Thanks for any comments.
Have you tried to remove the :link, and just have:
div.entry-content a {
color: #2C60BA;
text-decoration: none;
border: none;
}
Also, just in case your theme has overrides for visited links, you might also want to include a rule for visited as well to be sure:
div.entry-content a, div.entry-content a:visited{
color: #2C60BA;
text-decoration: none;
border: none;
}
Bryant provided the key insight in his first answer and my problem, after further experimenting, is now fully solved (see commments). I'm new here and not sure how to mark this resolved, but am guessing this is how to do it. Thanks again.
I folks I have a problem which I solved on one page, but it has not fixed it on another...
There is a grey box that comes up over an image link which I am trying to get rid of.
It still shows up here:
http://1aproductions.ots-internet3.net/work/?cat=dramas
It does not show up here anymore: (On the three recent projects at the bottom)
http://1aproductions.ots-internet3.net
Here's the code I have used, which got rid of it on the homepage, but not on the other pages:
.pg-icon {
font-size: 30px;
line-height: 40px;
color: #252525;
display: none;
background-color:transparent ;
background: none ;
}
.pc-wrapper .icon-circle {
background-color:transparent ;
background: none ;
}
Any help would be much appreciated!
Thanks
You don't have a pc-wrapper class on your dramas page, that's why the code in .pc-wrapper .icon-circle is ignored.
Your other pages seems to have a pg-items-wrapper class in common, so this code will make it work :
.pg-items-wrapper .icon-circle {
background-color:transparent ;
background: none ;
}
This is a problem that I've been having for quite some time now. For some reason, the CSS rules for my links aren't working properly. As far as I can tell, when using Chrome's Inspect Element tools or FireBug, the links appear to be styled correctly, but are displayed improperly. I've added separate classes to make separate styles of links, and even tried separating a:visited, and this fixed the basic issue for each class, but the normal a tag still displays visited links the wrong color. the CSS for my links has been below.
a:link, a:hover, a:active
{
text-decoration: none;
color: #FF8C00;
background-color: transparent;
}
a:visited
{
text-decoration: none;
color: #FF8C00;
background-color: transparent !important;
}
a.search:link, a.search:visited, a.search:hover, a.search:active
{
font-family: helvetica-light;
font-size: 19px;
color: #999;
text-decoration: none;
background-color: transparent;
}
a.nav:link, a.nav:visited, a.nav:active, a.nav:hover
{
text-decoration: none;
color: #E3E3E3;
font-family: helvetica-light;
font-size: 20px;
background-color: transparent;
}
For some reason, even though a:link/etc have "color: #FF8C00" they show up as black or dark gray when visited. Active, link and hover all work normally. All HTML is written as stuff
Have you tried changing;
color: #999;
Into;
color: #999 !important;
This will tell the CSS parser to overwrite the #FF8C00 color to #999.
Changing the order of the CSS blocks could also give you the expected result.
Sometimes getting the look you want might require some trial and error. :)
A couple of things you could try
clear your browser cache
Make sure no other css files are been called
Go to w3c html validation site
I finally found the solution to my own problem. I had initially copied elements of my CSS from an older project I was working on. Somehow, an "a:visted" declaration had ended up inline with an ID declaration and didn't break the CSS, but caused the links to not appear properly.