-2

IF

.fpss-template-uncut .navigation li.active,
.fpss-template-uncut .navigation li:hover

Then

.fpss-template-uncut .navigation-title {color: orange;}

How to write this code in CSS?

rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156
  • php parser/translator only process the files with .php extension. you can use js TO customize CSS – gahse Oct 02 '14 at 04:24
  • Maybe you are thinking of something like [Sass](http://sass-lang.com/) or [Less](http://lesscss.org/), CSS pre-processors. – Sam Oct 02 '14 at 04:26
  • I'm absolutely lost, why do you need an 'if' clause? Simply write it as is, you're already using a selector and a child class, or am I missing something? – Devin Oct 02 '14 at 05:09
  • show us the html code please – Mr_Green Oct 02 '14 at 05:10

3 Answers3

0

Super crude way if I understand somewhat what you want to do:

if (false !== stripos('your_container', '.fpss-template-uncut .navigation li.active, .fpss-template-uncut .navigation li:hover'))
{
    echo '.fpss-template-uncut .navigation-title {color: orange;}';
}

But you really don't specify so I could be way off.

Jared Eitnier
  • 7,012
  • 12
  • 68
  • 123
0

Here's how you will write...

$file = 'style.css';
// Open the file to get existing content
$current = file_get_contents($file);
// Append a new style to the file
$current .= "Your new css style here.";
// Write the contents back to the file
file_put_contents($file, $current);

But according to your question, you only wanted to make that navigation title to orange, why not setup jquery on it?

check this answer https://stackoverflow.com/a/8981521/2922445

Community
  • 1
  • 1
Nimitz E.
  • 95
  • 1
  • 13
0

Here is the best way Ive ever found to use php within css, its easy to set up and lets you be a lot more flexable

php in css the easier way

Ryan Knol
  • 304
  • 2
  • 7
  • Hello, please see http://stackoverflow.com/help/how-to-answer and in particular the section regarding links. – nha Jul 30 '15 at 22:11