F_C
F_C

Reputation: 1021

Opera doesn't recognize body css classes

cep I have an odd problem. I am building a site in which there are classes in the HTML body tag. All other browsers do as expected. However, Opera simple won't recognize these classes. In the source code, even in Opera, they are there. But when I look with "Inspect Element", the only class body has is "yui-sam-skin". I'm using Wordpress so the template is "<body <?php body_class(); ?>>

However, I've even tried <body class="<?php if(is_front_page() ) echo "home"; ?>">. Again, all browsers expect Opera recognize it and Opera has it in the source code, but not in Inspect Element. Any idea what's happening here? This doesn't happen with every site. A site I built not long ago doesn't have this problem for some reason. Even adding in the class with no PHP at all doesn't work.

Thanks for any help!

Upvotes: 0

Views: 298

Answers (1)

Patrick H. Lauke
Patrick H. Lauke

Reputation: 26

looking at your source code, you seem to have TWO body elements in your markup...one with a class of home, the other one with the yui class. Opera Dragonfly's inspection tool shows the actual DOM representation, after the browser's parser has sanitised your broken markup. view source and look for "body" and you'll see the problem. or, run the page through a validator. i'd suggest fixing that in the first instance.

Upvotes: 1

Related Questions