help how to color the echo output

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vin_akleh
Forum Commoner
Posts: 53
Joined: Sat Feb 14, 2009 10:26 am

help how to color the echo output

Post by vin_akleh »

need help
how can i color the output of the following code to any color i want????

<html>
<body>

<?php
echo "Roses are red";
?>

</body>
</html>
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: help how to color the echo output

Post by greyhoundcode »

Little bit of CSS could do the trick
watson516
Forum Contributor
Posts: 198
Joined: Mon Mar 20, 2006 9:19 pm
Location: Hamilton, Ontario

Re: help how to color the echo output

Post by watson516 »

<span style="color:#ff0000;">Roses Are Red</span>
Still Learning
Forum Commoner
Posts: 25
Joined: Tue Jan 27, 2009 3:57 pm
Location: Philadelphia

Re: help how to color the echo output

Post by Still Learning »

vin_akleh wrote:need help
how can i color the output of the following code to any color i want????

<html>
<body>

<?php
echo "Roses are red";
?>

</body>
</html>
You could also just use simple html inside the echo.

<?php echo "<font color=\"#FF3336\">Roses are red</font>";

Here's a link to the color codes too....

http://html-color-codes.com/
vin_akleh
Forum Commoner
Posts: 53
Joined: Sat Feb 14, 2009 10:26 am

Re: help how to color the echo output

Post by vin_akleh »

thanks for the help
socket1
Forum Commoner
Posts: 82
Joined: Mon Dec 08, 2008 7:40 pm
Location: Shokan, New York

Re: help how to color the echo output

Post by socket1 »

Still Learning wrote: <?php echo "<font color=\"#FF3336\">Roses are red</font>";
Or without escape quotes:

Code: Select all

<?php echo '<font color="#FF3336">Roses are red</font>'; ?>
Still Learning
Forum Commoner
Posts: 25
Joined: Tue Jan 27, 2009 3:57 pm
Location: Philadelphia

Re: help how to color the echo output

Post by Still Learning »

socket1 wrote:
Still Learning wrote: <?php echo "<font color=\"#FF3336\">Roses are red</font>";
Or without escape quotes:

Code: Select all

<?php echo '<font color="#FF3336">Roses are red</font>'; ?>
Cool. I help someone and I learn something new at the same time. That's nice to know.
watson516
Forum Contributor
Posts: 198
Joined: Mon Mar 20, 2006 9:19 pm
Location: Hamilton, Ontario

Re: help how to color the echo output

Post by watson516 »

Still Learning wrote:
socket1 wrote:
Still Learning wrote: <?php echo "<font color=\"#FF3336\">Roses are red</font>";
Or without escape quotes:

Code: Select all

<?php echo '<font color="#FF3336">Roses are red</font>'; ?>
Cool. I help someone and I learn something new at the same time. That's nice to know.
The font tag is old html.
Post Reply