New Landing How can we help? Cardinal custom css

Viewing 5 posts - 1 through 5 (of 5 total)
  • Posted in: Cardinal
  • #133916
    JGCPH
    Member
    Post count: 25

    I know it´s just me not getting it right. But I am trying to make a few css correction and adding it to custom css. This is what I add, but I don´t see the effect. What am I doing wrong?

    .span.highlighted {
    border-radius: 7px;
    color: #fff;
    margin-right: 0;
    padding: 2px 3px;
    }

    #133993
    HiroiSekai
    Member
    Post count: 144

    A couple things you can try/take note of:

    For one, CSS doesn’t require you to do a full .span.highlighted unless you have a class of “highlighted” on multiple elements, like a div and a span together. So I would first remove the .span if highlighted always applies to span tags.

    Second, I would check where you’re putting this CSS alteration. CSS is always overwritten depending on scope, meaning if another rule of this is loaded after yours, your rules are always superseded. There are two good ways to combat this. The first way is to install the Jetpack for WordPress.com plugin, which comes with a Edit CSS option. Any CSS in here has precedence most of the time, unless a theme has written above it.

    In the other case, you can set a !important next to any rules to enforce that they should overwrite anything else. So in your case:

    .highlighted {
    border-radius:7px !important;
    color:#fff !important;
    margin-right:0 !important;
    padding:2px 3px !important;
    }

    The downside to using !important everywhere is that you’ll be confused in overwriting over your !important codes. It’s not clean code. If the only other method fails, resort to this method.

    Good luck!

    #134000
    JGCPH
    Member
    Post count: 25

    Thank you – that !important fix worked. Will look into jetpack. Thank you

    #134011
    HiroiSekai
    Member
    Post count: 144

    No worries, glad it worked. Good luck with your site!

    #134151
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Thanks @HiroiSekai

    – Kyle

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register