Is it possible for me to put php in a css file eg to randomize a color.
Printable View
Is it possible for me to put php in a css file eg to randomize a color.
I'm not sure but there's one way of finding out , test it by trying it out ;).
If it doesn't work by doing it in the stylesheet then if it's something like the colour for one certain thing, have the css within the HTML tags with the php controlling it ;).
If I direct css via <link> in a .css will that still allow php?
Why not make CSS files for the colours you want then randomize the css file that is included.
no make a file i.e css.php
and haveCode:<style type="text/css">
css goes here and you can use php if u use <?PHP around the bit you want phped dont forget ?> to close :)
</style>
imo?
and I already have a style.css is there any bypass, eg redirect from .css to .php or could I use mod rewrite :S
huh what ?
inside your style.css put this:
.style1{
//styles here
}
.style2{
//styles here
}
.style3{
//styles here
}
.style4{
//styles here
}
Then in your main file place a php script that randomizes to use
<div class="style1"></div>
or
<div class="style2"></div>
or
<div class="style3"></div>
or
<div class="style4"></div>
or use <span>'s, whatever you need :p
Easyest way no ?
(PS: imo = in my opinion)
The thing is I already have like 60 pages, so i was jw if it was possible to change the .css or .htaccess