-3

I can't figure out on how to change the color of the text "This text should be black". for a HTML email in Content Builder I've tried to change the color from the style of the text to #1A1A1A which is black but for some reason it doesn't change. I also tried to make it !important but still no change. Can you please advice?

<table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td bgcolor="#FFFFFF">
            <!--[if gte mso 9]><table border="0" cellpadding="0" cellspacing="0" width="320"><tr><td valign="top"><![endif]-->
            <table border="0" cellpadding="0" cellspacing="0" width="320" align="left" class="w100pc hauto" bgcolor="#FFFFFF">
                <tr>
                    <td class="hide" height="52"></td>
                </tr> 
                <tr>
                    <td valign="top">
                        <table border="0" cellpadding="0" cellspacing="0" class="pb10">
                            <tr>
                                <td width="32" class="w24"></td>
                                <td style="color:#1A1A1A;font-family:'Roboto', Arial, sans-serif;font-weight:bold;font-size:32px;line-height:40px;" class="fallback-bold center">
 <a href="https://www.test.com/eu/" target="_blank" style="text-decoration:none;color:#1A1A1A;" alias="Hero">
       %%[IF Country == "France" THEN]%%</a><a href="https://www.test.com/fr/" target="_blank" style="text-decoration:color:#1A1A1A;" alias="Hero">This text should be black</a>%%[ELSEIF Country == "Germany" THEN]%%<a href="https://www.test.com/de/" target="_blank" style="text-decoration:color:#1A1A1A;" alias="Hero">This text should be black</a>%%[ELSE]%%<a href="https://www.test.com/eu/" target="_blank" style="text-decoration:color:#1A1A1A;" alias="Hero">This text should be black</a>%%[ENDIF]%%

                                </td>
                                <td width="10" class="w24"></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                  <td height="15"></td>
                </tr>
            </table>
            <!--[if gte mso 9]></td><td valign="top"><![endif]-->
            <table border="0" cellpadding="0" cellspacing="0" width="320" align="left" class="w100pc hauto" bgcolor="#FFFFFF">
                <tr>
                    <td>
                        <a href="https://www.test.com/eu/" target="_blank" style="text-decoration:none;color:#ffffff;" alias="Hero">
                            <img src="" alt="This text should be black" border="0" width="320" height="224" style="display:block;" class="w100pc hauto right">
                        </a>
                    </td>
                </tr>
            </table>
            <!--[if gte mso 9]></td></tr></table><![endif]-->
        </td>
    </tr>
</table>
3
  • Is this related to Salesforce somehow? Adding more (or more relevant) tags would be helpful.
    – Derek F
    Commented Apr 3, 2023 at 14:21
  • yes, because the issue I have is after I add the dynamic content
    – Duicug
    Commented Apr 3, 2023 at 14:24
  • 2
    but what part of Salesforce are you using? We can't read your mind here. You need to make it abundantly clear how Salesforce is involved. Edit your question and/or its tags.
    – Derek F
    Commented Apr 3, 2023 at 14:28

1 Answer 1

1
  • First remark, I believe you are missing an "@" before Country unless it's a field in the DE used for the send, in this case, don't forget to use AttributeValue function.
  • Second remark, to resolve the issue, you either need to remove
    text-decoration or replace it by text-decoration:none as in line number 32.

Something like this should work:

<table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td bgcolor="#FFFFFF">
            <!--[if gte mso 9]><table border="0" cellpadding="0" cellspacing="0" width="320"><tr><td valign="top"><![endif]-->
            <table border="0" cellpadding="0" cellspacing="0" width="320" align="left" class="w100pc hauto" bgcolor="#FFFFFF">
                <tr>
                    <td class="hide" height="52"></td>
                </tr> 
                <tr>
                    <td valign="top">
                        <table border="0" cellpadding="0" cellspacing="0" class="pb10">
                            <tr>
                                <td width="32" class="w24"></td>
                                <td style="color:#1A1A1A;font-family:'Roboto', Arial, sans-serif;font-weight:bold;font-size:32px;line-height:40px;" class="fallback-bold center">
 <a href="https://www.test.com/eu/" target="_blank" style="text-decoration:none;color:#1A1A1A;" alias="Hero">
       %%[IF @Country == "France" THEN]%%</a><a href="https://www.test.com/fr/" target="_blank" style="color:#1A1A1A;" alias="Hero">This text should be black</a>%%[ELSEIF @Country == "Germany" THEN]%%<a href="https://www.test.com/de/" target="_blank" style="color:#1A1A1A;" alias="Hero">This text should be black</a>%%[ELSE]%%<a href="https://www.test.com/eu/" target="_blank" style="color:#1A1A1A;" alias="Hero">This text should be black</a>%%[ENDIF]%%

                                </td>
                                <td width="10" class="w24"></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                  <td height="15"></td>
                </tr>
            </table>
            <!--[if gte mso 9]></td><td valign="top"><![endif]-->
            <table border="0" cellpadding="0" cellspacing="0" width="320" align="left" class="w100pc hauto" bgcolor="#FFFFFF">
                <tr>
                    <td>
                        <a href="https://www.test.com/eu/" target="_blank" style="text-decoration:none;color:#ffffff;" alias="Hero">
                            <img src="" alt="This text should be black" border="0" width="320" height="224" style="display:block;" class="w100pc hauto right">
                        </a>
                    </td>
                </tr>
            </table>
            <!--[if gte mso 9]></td></tr></table><![endif]-->
        </td>
    </tr>
</table>

Not the answer you're looking for? Browse other questions tagged .