Jump to content

Randomizing text background colors - SO HOT 5mins Ago


ridiculous

Recommended Posts

[quote author=corbin link=topic=116642.msg475377#msg475377 date=1164755056]
Use a style sheet and then make the div names dynamic and make them 1 2 3 or something so you could keep track of them with an auto incremented value or something... Then make them random or go 12345...
[/quote]


What do you mean by "make them 1 2 3 or something so you could keep track of them with an auto incremented value or something... Then make them random or go 12345..."?
Uhm, assuming your using php, assign different style sheets to a random value.

[code]
<?PHP
$rand=rand(1,3);
if($rand==1){
echo "<link rel='stylesheet' href='blabla/mystyle1.css' type='text/css' />";
}else if($rand==2){
echo "<link rel='stylesheet' href='blabla/mystyle2.css' type='text/css' />";
}else{
echo "<link rel='stylesheet' href='blabla/mystyle3.css' type='text/css' />";
}
?>
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.