Help:Coloring text: Difference between revisions
From Proteopedia
Jump to navigationJump to search
Eric Martz (talk | contribs) |
No edit summary |
||
| Line 89: | Line 89: | ||
You can color using CSS spans: <span style="color:red;font-weight:bold;">Red</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 <span style="color:#8000ff;font-weight:bold;">Purple</span> which looks like this: <span style="color:#8000ff;font-weight:bold;">'''Purple'''</span>. | You can color using CSS spans: <span style="color:red;font-weight:bold;">Red</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 <span style="color:#8000ff;font-weight:bold;">Purple</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: <span style="background-color:yellow;padding-left: | Span style colors also work for light colors, using a colored background with black text: <span style="background-color:yellow;padding-left:0.3em;padding-right:0.3em;">Yellow</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;"><font color="red">'''Red'''</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;"><font color="red">'''Red'''</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 <font color="#8000ff">'''Purple'''</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 <font color="#8000ff">'''Purple'''</font> which looks like this: <font color="#8000ff">'''Purple'''</font>.--> | ||