Trying to change font colour – CSS not working

Homepage Forums Free Support Forum Blackoot Lite Blackoot Lite Support Trying to change font colour – CSS not working

Trying to change font colour – CSS not working

This topic contains 5 replies, has 2 voices, and was last updated by  iceable 3 months, 2 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #21363
    Trying to change font colour – CSS not working

    dandandan
    Participant

    Hi,

    I’m trying to change the font colour using CSS. I’ve searched through the forums and have come across various answers, such as this:
    https://www.iceablethemes.com/forums/topic/modify-themes-colors/

    I’ve installed Simple Custom CSS (as mentioned above) and tried it there too, but it doesn’t change the colour (text-decoration and other stuff works, etc). I’m trying to avoid editing the actual theme CSS in FTP or creating a child theme, but I suppose I’ll have to revert to that if there’s no other way!

    Thanks for the help.

    #21364
    Reply to: Trying to change font colour – CSS not working

    iceable
    Keymaster
    Support
    Happy with my help?
    Buy me a beer!

    Hi,

    The topic you have found is pretty old (2015); you don’t need a plugin (or a child theme) anymore to add custom CSS: the WordPress customizer now allows you to add additional custom CSS directly in Appearance > Customize > Additional CSS.

    What is the actual CSS code you tried that didn’t work? Please let me know so I can help you find what might be wrong in your code.

    #21390
    Reply to: Trying to change font colour – CSS not working

    dandandan
    Participant

    Hi,

    First off, I was really stupid for not actually specifying: I’m trying to change colours of links. Normal text changes colour fine. I’m sorry, it just skipped my brain when I was posting!

    Secondly, thanks for the reply! I was using the wordpress customiser at first, but as that didn’t work, I opted for the Simple Custom CSS plugin, in case that worked, but have since just reverted to the built-in wordpress one.

    I can change text decoration etc of links no problem, it just seems to be colours which are the problem. Tried it with hover aswell, to no avail.

    <span class="projecttitle">Project Name</span>

    .projecttitle:hover
    {
        color: red;
        text-decoration:underline;
    }

    Sorry for the late reply, my email notification went to my junk and I forgot to check!

    #21391
    Reply to: Trying to change font colour – CSS not working

    iceable
    Keymaster
    Support
    Happy with my help?
    Buy me a beer!

    No problem!

    Well the color for links in the default stylesheet are defined with the “a” and “a:hover”, so this is probably what is missing from your example.

    If your span is inside the a tag, like so:

    <a href="..."><span class="projecttitle">Project Name</span></a>

    You should be able to change the color with:

    a .projectitle {}
    a:hover .projecttitle {}

    And if the a tag is inside the span:

    <span class="projecttitle"><a href="...">Project Name</a></span>

    .projectitle a {}
    .projecttitle a:hover {}

    I couldn’t have a look at your site since it is in “coming soon” mode, but I hope this helps!

    #21393
    Reply to: Trying to change font colour – CSS not working

    dandandan
    Participant

    God damnit, it was that simple!

    Can’t believe I forgot about that; I did some website stuff about 5 years ago, just shows how quickly stuff can disappear from your brain!

    Although, what’s the reason behind being able to change the text size and decoration with just

    .project-title
    {
        font-size: 28px;
    }

    but changing color needs the .project-title a {}?

    Just a bit odd to me, might be a simple reason though. Anyway, thanks a lot for your help, very much appreciated!

    • This reply was modified 3 months, 2 weeks ago by  dandandan.
    • This reply was modified 3 months, 2 weeks ago by  dandandan.
    #21396
    Reply to: Trying to change font colour – CSS not working

    iceable
    Keymaster
    Support
    Happy with my help?
    Buy me a beer!

    Glad I could help!

    As for your follow-up question: the reason is simply that there is a color in the default stylesheet applied to the “a” selector, so you need to target “.project-title a” to override it and set another color.
    The default stylesheet does not set a specific font size for this selector though, so you don’t need to be this specific to change it; this is why both “.project-title” or “.project-title a” can work for font size.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.


PayPal Verified
Secured by PayPal
Secure Credit Card payments powered by Stripe
SiteLock