utdfederation Posted September 5, 2008 Share Posted September 5, 2008 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 More sharing options...
Ken2k7 Posted September 5, 2008 Share Posted September 5, 2008 Wrap each word in a <font> or <span> tag and assign the specified color? Link to comment https://forums.phpfreaks.com/topic/122938-changing-colors/#findComment-634912 Share on other sites More sharing options...
Fadion Posted September 5, 2008 Share Posted September 5, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.