Forum Moderators: not2easy

Message Too Old, No Replies

Why Does My CSS Show Up Twice In Firebug?

         

Planet13

3:47 pm on Nov 13, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



A little hard to explain, but when I write a style rule in my CSS file like this:

#service_areas > div > div > div {
margin-bottom: 10px;
}

It shows up TWICE in Firebug (and the various other CSS browser inspectors).

It shows up once normally, and once with a strike-through of the marging-bottom: 10px

I've double checked my style sheet and I don't repeat that styling.

The first time it appears in the inspector (where it appears normally) right next to it is the location:

http://www.example.com/wp-content/themes/Divi-child/style.css?ver=4.0 (Line 194)


But where it is struck-through, the location is listed as:

http://www.example.com/wp-content/themes/Divi-child/style.css?ver=2.2 (Line 194)


So what is the difference between the ver=4.0 and the ver=2.2 ? Why listed twice? And why is it struck-through in the second listing?

Thanks in advance.

[edited by: not2easy at 5:48 pm (utc) on Nov 13, 2014]
[edit reason] URL Exemplified [/edit]

Fotiman

4:17 pm on Nov 13, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



That looks like a Wordpress issue, loading the stylesheet multiple times. A quick G search suggests it may be a Wordpress plugin or a parent/child theme issue. If you view source on the page you'll see 2 <link> elements pointing to the stylesheets you list above.

And why is it struck-through in the second listing?

That just means that the style rule is not applied because another style rule with higher specificity (or the same specificity, but defined later) is overriding that rule. It's basically just to help you identify all the places that set a property, but to identify which rule is actually being used.

Your next stop should be to a Wordpress forum to find out why it's injecting the stylesheet twice.

Planet13

4:34 pm on Nov 13, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thank you again, Fotiman:

If you view source on the page you'll see 2 <link> elements pointing to the stylesheets you list above.

You are correct.

Before I ask in the wordpress forum, does the fact that one link has ?ver=2.2 and one has ?ver=4.0 appended to it mean anything?

Thanks in advance.

Fotiman

4:39 pm on Nov 13, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm sure it does, and I suspect it has to do with parent/child themes, but I don't know enough about Wordpress to provide useful feedback.

Planet13

5:20 pm on Nov 13, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ok, Thanks! Will check into the wordpress forum.

Planet13

10:27 pm on Nov 13, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just to make it easier on those who might have the same problem, the solution is found here:

[webmasterworld.com...]

SPOILER ALERT: Bad code in the wordpress codex.