afish674 Posted October 25, 2012 Share Posted October 25, 2012 (edited) In the Wordpress template i'm developing a class is returned dependent on the existance of a sidebar like so: <div id="main" class="<?php echo roots_main_class();?> round-corners wborder" role="main"> <?php include roots_template_path(); ?> </div> However, although this class is picked up in Firebug on the left, on the right panel it is not detected, meaning any rules applied to it are not working. Any idea why is this happening? Picture of problem in firebug (the class I want to style to 100% width is called "no-side") Thanks! Edited October 25, 2012 by afish674 Link to comment Share on other sites More sharing options...
dsonesuk Posted October 25, 2012 Share Posted October 25, 2012 (edited) If there are no rules set for the class anywhere, IT wont show it, it will only show those that relate to that specific element in order of precedence. Wait, the id width setting will take precendence over all, that is why it is not showing if you have not already set it, you would have to use #main .no-side {width:100%;} You would have to remove the width from #main and apply it to two new classes, one for normal width: 801px; and other for 'no-side' of the classes that this width would be used on, then use for example #content .no-side {width: 100%} #content .normal {width: 801px} and get php to show one or the other when required. Edited October 25, 2012 by dsonesuk Link to comment Share on other sites More sharing options...
afish674 Posted October 26, 2012 Author Share Posted October 26, 2012 Cheers dsonesuk, that worked perfectly! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now