Support » Fixing WordPress » Adding CSS to style.css not working, but works using new 4.9 editor

  • Hi there!

    I’ve always used the ‘normal’ editor to edit my style.css (the one under ‘appearance’), but since 4.9 I’m running into a problem that new code inserted into style.css does not seem to make visible changes (I checked that changes are saved correctly to the file). When I put the exact same code in the new ‘additional css’ it works instantly.

    I don’t mind putting my custom CSS in one place or the other, but now everything from before 4.9 is in my style.css, while I have to put new CSS in the ‘additional CSS’ section to make it work…

    Any feedback or suggestions are welcome – ideally I like to keep on using the ‘old’ style.css editor (edit…save file…check if works…haha)

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi – this is off-topic from my reason for coming here by 99% but FYI today I am having the same issue with other plugins with custom css; my child-theme css is not taking effect, nor are a couple of formerly-working plugin functions for 2 other plugins. I can only get css results (I haven’t tried with this plugin) via the 4.9.1 (cramped) custom CSS window in Customiser. I was thinking it had to do with my Host… now I don’t know what to think.

    EDIT: Hmmm post withheld for 72 hr. that’s going to be helpful for the fellow actively working on his site with issues 20 minutes ago.

    • This reply was modified 2 years, 6 months ago by aajaanron.
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Support Team Volunteer

    @aajaanron, if you need support then per the forum welcome please create your own new forum post. Thanks.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Support Team Volunteer

    @teunbakker, just to check… did you put your CSS *after* the comments at the top of the editor?

    Please provide a link your site so we can see how the CSS is falling out.

    @sterndata – Not looking for support on this issue, just letting him know someone has a similar experience in that only 4.9.1 editor was effecting change. Guess I should have more more explicit with “Hi ‘@teunbakker'” I read the forum welcome thanks.

    @sterndata thanks for the reply!

    My style.css file is by now quite substantial after 3 years of tweaking 😉 The CSS that doesn’t do anything was in a line somewhere in the middle of the file.

    When putting that exact line in the “additional css” thing, it works instantly. By the way, that is the first and *only* line of custom css I’ve ever added – nothing else there.

    I’m mostly wondering why all my CSS from the style.css is applied, but that extra line is not working straight as it should from style.css.

    my website is https://www.20watt.nl and the affected CSS line is “.dropdown-menu > li ul”

    • This reply was modified 2 years, 6 months ago by teunbakker.
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Support Team Volunteer

    It’s a little hard to get an idea due to minification. Turn off all minification and caching while you’re trying to solve this

    Anyhow, this is what I see for that selector

    See https://cldup.com/u_UNHwGrvVr/8ziWyy.png

    It’s actually the selector right above that has the affecting css code (I’ve attached a picture-link to illustrate). What I was trying to do was make the dropdown menu wider so a longer menu-item did not become two lines.

    https://ibb.co/jDD0cG

    But this is a little beside my actual question…css actually does work, it just doesn’t work when it’s put directly in style.css. To illustrate I’ve removed the css from “additional css” and put it back in style.css.

    When you now inspect with Chrome, you won’t see “width: 180px” under “.dropdown-menu > li ul” (and visually it also does not work)…but trust me it’s there in my style.css…

    https://ibb.co/c2nMjw

    • This reply was modified 2 years, 6 months ago by teunbakker.
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Support Team Volunteer

    You may have to either move it down in the css file (so it’s after whatever it’s modifying) or see if it needs to be inside (or outside) of a media query.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Adding CSS to style.css not working, but works using new 4.9 editor’ is closed to new replies.