Jump to content

[SOLVED] Adding Colour- HELP


SilentQ-noob-

Recommended Posts

On one page, named words.php, the person is asked to enter four words and hit submit- this then posts it to a new page. On this form - words_process.php, the words are separated and ordered one on top of the other- what I also want to do, but cant, is give each word a different colour.

 

$worddivide = explode(" ", $_POST['words']);
echo $worddivide[0]."<br />";
echo $worddivide[1]."<br />";
echo $worddivide[2]."<br />";
echo $worddivide[3]."<br />";

 

make first word blue, second red for example. Any help would be greatly appreciated. THANKS!

-NOOB-

Link to comment
https://forums.phpfreaks.com/topic/60457-solved-adding-colour-help/
Share on other sites

hmm

try

<style type="text/css">
<!--
.style1 {color: #000099}
.style2 {color: #FF0000}
-->
</style>
<?
$worddivide = explode(" ", $_POST['words']);
for ($ctr=0;$ctr<=count($worddivide);$ctr++)
{
echo "<span class='style".$ctr."'>".$worddivide[$ctr]."<br /></span>";
}
?>

 

hope that helps  ;D ;D ;D

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.