Menu

how to use background coloring in HTML node

nnako
2016-02-29
2016-03-01
  • nnako

    nnako - 2016-02-29

    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 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.

     
    • Volker Börchers

      The Swing HTML renderer understands HTML 4. Old fashioned tags do work:

      <font color="#cc6600">sort of red</font>
      

      Volker

       

      Last edit: Volker Börchers 2016-02-29
      • nnako

        nnako - 2016-03-01

        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>
                <td bgcolor="#cc6600">
                  sort of red
                </td>
              </tr>
            </table>