I am trying to put some basic HTML code into the node core in order to adjust the background color of some words within my node core text. So I open the HTML editor for the node core and start typing...
When I use the color attribute style with background-color within the <p> tag, I see a paragraph with a perfectly colored background:
<p style="background-color: #00FF00"> WHOLE PARAGRAPH IN GREEN </p>
When I try to use the <span> tag together with the style attribute, I would expect to see not the whole paragraph but at least the text portion within the span as highlighted with the appropriate background color:
<span style="background-color: #00FF00"> SOME WORDS IN GREEN </span>
But as soon as I close the editor window, the <span> tag gets deleted from the HTML content.
Is there a way to set the background color of single words using HTML within nodes?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks. Your solution fits for setting the foreground color. The background color for single words doesn't seem to come so easily if using the bgcolor attribute. I've found a way using tables. Thus I can limit the extent of background text coloring to a single cell:
<table><tr><tdbgcolor="#cc6600">
sort of red
</td></tr></table>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi.
I am trying to put some basic HTML code into the node core in order to adjust the background color of some words within my node core text. So I open the HTML editor for the node core and start typing...
When I use the color attribute
style
withbackground-color
within the<p>
tag, I see a paragraph with a perfectly colored background:<p style="background-color: #00FF00"> WHOLE PARAGRAPH IN GREEN </p>
When I try to use the
<span>
tag together with thestyle
attribute, I would expect to see not the whole paragraph but at least the text portion within the span as highlighted with the appropriate background color:<span style="background-color: #00FF00"> SOME WORDS IN GREEN </span>
But as soon as I close the editor window, the
<span>
tag gets deleted from the HTML content.Is there a way to set the background color of single words using HTML within nodes?
Thanks.
The Swing HTML renderer understands HTML 4. Old fashioned tags do work:
Volker
Last edit: Volker Börchers 2016-02-29
Thanks. Your solution fits for setting the foreground color. The background color for single words doesn't seem to come so easily if using the
bgcolor
attribute. I've found a way using tables. Thus I can limit the extent of background text coloring to a single cell: