Help:Coloring text: Difference between revisions

From Proteopedia
Jump to navigationJump to search
Eric Martz (talk | contribs)
Jaime Prilusky (talk | contribs)
No edit summary
Line 89: Line 89:
You can color using CSS spans: &lt;span style="color:red;font-weight:bold;">Red&lt;/span>, which looks like this: <span style="color:red;font-weight:bold;">Red</span>. In addition to color names, you can use Red-Green-Blue [https://www.rapidtables.com/web/color/RGB_Color.html (RGB) hexadecimal codes] following "#", for example &lt;span style="color:#8000ff;font-weight:bold;">Purple&lt;/span> which looks like this: <span style="color:#8000ff;font-weight:bold;">'''Purple'''</span>.
You can color using CSS spans: &lt;span style="color:red;font-weight:bold;">Red&lt;/span>, which looks like this: <span style="color:red;font-weight:bold;">Red</span>. In addition to color names, you can use Red-Green-Blue [https://www.rapidtables.com/web/color/RGB_Color.html (RGB) hexadecimal codes] following "#", for example &lt;span style="color:#8000ff;font-weight:bold;">Purple&lt;/span> which looks like this: <span style="color:#8000ff;font-weight:bold;">'''Purple'''</span>.


Span style colors also work for light colors, using a colored background with black text: &lt;span style="background-color:yellow;padding-left:7px;padding-right:7px;">Yellow&lt;/span>. The "padding" makes the color extend slightly beyond the text, which looks better: <span style="background-color:yellow;padding-left:7px;padding-right:7px;">Yellow</span>.
Span style colors also work for light colors, using a colored background with black text: &lt;span style="background-color:yellow;padding-left:0.3em;padding-right:0.3em;">Yellow&lt;/span>. The "padding" makes the color extend slightly beyond the text, which looks better: <span style="background-color:yellow;padding-left:0.3em;padding-right:0.3em;">Yellow</span>. Padding given in 'em' units is relative to the font-size of the element; 0.3em means to leave a padding equal to 0.3 times the size of the current font.


==HTML Font Colors==
==HTML Font Colors==
'''NOT Recommended''' (here for historical reference). Coloring using HTML font tags is [https://www.w3schools.com/tags/tag_font.asp '''NOT recommended''' as it is technically not supported by HTML5]: <span style="color:gray;">&lt;font color="red">'''Red'''&lt;/font></span>
'''NOT Recommended''' (here for historical reference). Coloring using HTML font tags is [https://www.w3schools.com/tags/tag_font.asp '''NOT recommended''' as it is technically not supported by HTML5]: <span style="color:gray;">&lt;font color="red">'''Red'''&lt;/font></span>
<!-- which looks like this: <font color="red">'''Red'''</font>. In addition to color names, you can use Red-Green-Blue [https://www.rapidtables.com/web/color/RGB_Color.html (RGB) hexadecimal codes] following "#", for example &lt;font color="#8000ff">'''Purple'''&lt;/font> which looks like this: <font color="#8000ff">'''Purple'''</font>.-->
<!-- which looks like this: <font color="red">'''Red'''</font>. In addition to color names, you can use Red-Green-Blue [https://www.rapidtables.com/web/color/RGB_Color.html (RGB) hexadecimal codes] following "#", for example &lt;font color="#8000ff">'''Purple'''&lt;/font> which looks like this: <font color="#8000ff">'''Purple'''</font>.-->