+ 1
How to echo a colored or formatted text?
How to echo a colored or formatted text like we do in html using <font> tags
3 ответов
+ 7
<?php
echo "<font size='5' color='red' face='Arial'>П</font>"
?>
+ 4
<font> element is deprecated in html5: use css instead...
<?php
echo '<span style="font-size:5px; font-family:Arial;">formated text</span>'
?>
... or even better practice to not inline css property but define some rules and target the element ( by use of class and/or id attributes ).
Good practice is also to use the more semantical significant tag available, and use <span> and <div> as default generic else ( respectively for inlined or block type content box ).