foundation / foundation-emails

Quickly create responsive HTML emails that work on any device and client. Even Outlook.
https://get.foundation/emails/docs/
MIT License
7.77k stars 1.09k forks source link

Anchor link in expanded button does not match expanded button width in windows outlook client #1019

Open DaleFoley opened 4 years ago

DaleFoley commented 4 years ago

How can we reproduce this bug?

<!-- Emails use the XHTML Strict doctype -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
    <!-- The character set should be utf-8 -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width"/>
    <!-- Link to the email's CSS, which will be inlined into the email -->
    <link rel="stylesheet" href="css/foundation-emails-2_3_1.css">
    <style>

    </style>
</head>

<body>
<!-- Wrapper for the body of the email -->
<table class="body" data-made-with-foundation>
    <tr>
        <!-- The class, align, and <center> tag center the container -->
        <td class="float-center" align="center" valign="top">
            <center>
                <table class="container"> <!-- container start -->
                    <tr>
                        <td>
                            <table class="row">
                                <tbody>
                                <tr>
                                    <column>
                                        <table class="button expanded">
                                            <tr>
                                                <td>
                                                    <table>
                                                        <tr>
                                                            <td>
                                                                <center data-parsed><a href="#" align="center" class="float-center">Expanded Button</a></center>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                                <td class="expander"></td>
                                            </tr>
                                        </table>
                                        <table class="button small-expanded">
                                            <tr>
                                                <td>
                                                    <table>
                                                        <tr>
                                                            <td><a href="#">Expand small only</a></td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </column>
                                </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                </table> <!-- container end -->
            </center>
        </td>
    </tr>
</table>
</body>
</html>

What did you expect to happen?

As per the documentation, an expanded button is present filling the width of the container, and a smaller button is present underneath it. The expanded button wraps an anchor link that has the same width as the expanded button itself and the user can click anywhere on the expanded button to go to the specified url in the anchors href attribute.

What happened instead?

Buttons rendered as expected, but the anchor element is not expanded (should be the same width as the expanded button) and the user is forced to click in the middle area of the expanded button.

What email clients does this happen in?

Microsoft 365 MSO 16.0.13029.20232 32 bit

DaleFoley commented 4 years ago

Referencing this: https://www.campaignmonitor.com/css/email-client/outlook-2007-16/

Display CSS property seems to not be supported for outlook client, which means we can't apply width to the attribute, as you need to set the display to block or inline-block for the width to take affect.