Hey guys I am wondering how I can display certain CSS only on my homepage or if it is possible. I have php code generating html code and want a specific class element hidden only on the homepage, is this possible with CSS at all? Or maybe with javascript maybe? Thanks all!
That's very possible. CSS rules are applied in sequence as they are read, so if you have rules for the classes in the main page and load that from a <style> ... </style> section that is read after the general stylesheet then it will override the other setting.
Yea I see what you mean. The only problem I am having is my home page or lets call it root of my site is here: http://www.acne-skin.org/ and I am trying to get a the same style sheet element, call it class XYZ to display differently on this page of my site http://www.acne-skin.org/?gccid=139475 It's wordpress and I guess it's actually the same page... but maybe there is another CSS way or maybe I will look for a is_root() type of function... Maybe I'm just trying for something that can't be done...
Thank you for your help it let me know that I could do this, which is what I did and it worked: I added this after the header which is where the style sheet was called. <?php $x=$_SERVER['REQUEST_URI']; if ($x=='/'){ echo "<style>CUSTOM CSS HERE</style>"; } ?> thanks again