0

Without using cascading style sheets or more complicated methods it is easy to introduce coloured text into your HTML sites/documents. This is done by using the <font> tag and its options. In addition to this the <font> tag is more backwards-compatible than most other style commands.

The way to do it is: <font color=#RRGGBB>your text here</font> where RR GG and BB are the colour componenets in hexadecimal. Try veiwing the following example

[CODE]
<html>
    <head>
        <title>Multi-Coloured Text example &copy1o0oBhP :)</title>
    </head>
    <body>
        <table>
            <tr><td><font color="#FF0000"><b>This is RED text</b></font></td><td><b><font color="#FF0000">RRGGBB = FF0000</font></b></td></tr>
            <tr><td><font color="#00FF00"><b>This is GREEN text</b></font></td><td><b><font color="#00FF00">RRGGBB = 00FF00</font></b></td></tr>
            <tr><td><font color="#0000FF"><b>This is BLUE text</b></font></td><td><b><font color="#0000FF">RRGGBB = 0000FF</font></b></td></tr>
        </table>
    </body>
</html>
[/CODE]
4
Contributors
7
Replies
9
Views
12 Years
Discussion Span
Last Post by mmiikkee12
0

I am still working on perfecting the engine which powers these code snippets. Not all languages are full supported, but I can assure you that I am working on it!

0

no worries, i thought that code tags preserved the formatting? its worked before when i have copied/pasted from devc++, i might write the html in devc++ and paste and see what happens...

0

Hmm it is ignoring the code tags by the look of things... dunno if that is something to check?

0

There is no need for code tags in the Code Snippets library. The language the code is written in determines how it's formatted.

0

ACTUALLy the code for colours is in hexadecimal form but you can even put the color name
<html>
<body>
<font color="red"> this will be in red </font>
</body>
</html>
however it depends upon your browser not all browser support all colours

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.