Text color in php
Solved
martine et chantal
Posted messages
517
Status
Member
-
bat -
bat -
Hello,
I know how to change the color of text like this:
echo '<font color="red">hello</font>';
But how do I do it for a variable?
echo '<font color="red">hello</font>'.$variable;
Configuration: Windows XP / Internet Explorer 8.0
I know how to change the color of text like this:
echo '<font color="red">hello</font>';
But how do I do it for a variable?
echo '<font color="red">hello</font>'.$variable;
Configuration: Windows XP / Internet Explorer 8.0
6 answers
-
Hello,
DO NOT USE FONT ANYMORE !!!!!!
It's over! Bearkk! not pretty....
A general rule: any element that affects the presentation of the page (color, size, etc...) should be managed in a style. Example, an alert text,
before:
<b><font color='red'>ALERT</font></b>
now:
<b style='color: red;'>ALERT</b>
For PHP:
<?php
$color = 'red';
?>
<b style='color: <?php echo $color; ?>;'>ALERT</b>
A+