Jump to content

changing colors


utdfederation

Recommended Posts

hello again all.

 

ok lets say on 1 line i wanted to type to be displayed in php "hello and thank you for visiting my site" but every word be a different color how would one go about scripting this?

 

this would need to be 1 line of text.

 

example/

 

hello (red) and (green) thank you (blue) for (white) visiting (black) my (grey) site (yellow)

 

hope you follow what i mean

Link to comment
https://forums.phpfreaks.com/topic/122938-changing-colors/
Share on other sites

Don't use < font >, that tag is evil. Use span instead and this hasn't anything to do with PHP. Something like this:

 

<style type="text/css">
     .red{
          color:red;
     }
     .blue{
          color:blue;
     }
</style>
hello <span class="red">and</span> thank <span class="blue">you</spa> for visiting my site
<!-- or you can even use inline css, but that isn't a good way obviously -->
hello and <span style="color:red;">thank</span> you <span style="color:yellow;">for</span> <span style="color:black;">visiting</span> my site

Link to comment
https://forums.phpfreaks.com/topic/122938-changing-colors/#findComment-634963
Share on other sites

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.