Site logo

Archived topic

Custom CSS vs style.css in Child Theme

4 replies · Started by Mary Pearson on December 15, 2015

Viewing posts 1–5 of 5

Hi Tom,

My new site at https://christiangayschat.com is quite slow. Several things were suggested to me to help speed things up including deleting the Simple Custom CSS plugin by just putting everything into the style.css file of child theme.

Seemed easy enough so that's what I've done. All seems to be working well except the spacing of my menus. The code works in Custom CSS but not in style.css of child theme.

/* Nav Menu Logged Out - space items */
.menu-item-897, .menu-item-310, .menu-item-1595, .menu-item-1037, .menu-item-437 {
padding-left: 60px ; }
.menu-item-307 {
padding-left: 20px ; }

/* Nav Menu Logged In - space items */
.menu-item-809, .menu-item-48, .menu-item-433, .menu-item-810, .menu-item-1593, .menu-item-55 {
padding-left: 40px ; }
.menu-item-47 {
padding-left: 20px ; }

Any idea what the problem might be?
Thanks!

Any idea what I'm doing wrong by just using style.css in the child theme instead of Custom CSS plugin? It isn't working for me.

Hi Mary,

Sorry for not getting back to you sooner - this slipped by somehow.

First, having your CSS in the Custom CSS plugin vs a child theme will not make any difference to the speed of your website. If it does, it won't even be noticeable by Google bots.

You can try adding !important after your values to see if they aren't specific enough to override the core defaults.

.menu-item-307 {
    padding-left: 20px !important; 
}

Thank you Tom. I'll take your word for it in spite of what I was told. It's easier to use the Simple CSS plugin anyway, and you have proven to me over the years that you know what you're talking about.

Much appreciated.

Merry Christmas!

Hi Mary,

Some argue that having the CSS in the <head> is actually faster than linking to an external stylesheet :)

Merry Christmas to you as well!

This archived topic is closed to new replies.