CSS Outlook 电子邮件无法正常工作

CSS in Outlook email its not working properly

我一直在做一个项目,其中一个功能是发送电子邮件验证消息。我正在尝试优化它,特别是针对 outlook 平台。我一直遇到的问题是 flex-box 在移动应用程序上无法正常工作,但在网络应用程序上运行正常。我正在使用 flex-direction: column,但它显示为 row。有什么办法可以克服这个问题吗?

*,
*::after,
*::before {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

html {
    font-family: 'Fabula Valhalla';
    font-weight: normal;
    font-style: normal;
    color: #FFFFFF;
    font-size: 16px;
}

body{
    width: 100vw;
    height: 100vh;
}

.background{
    width: 100vw;
    height: 100vh;
    background-color: #151A29;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-container{
    background-color: rgba(0, 0, 0, 0.33);
    width: 80%;
    height: auto;
    padding: 35px;
    display: flex;
    align-items: center;
    flex-direction: column;
    border-radius: 25px;
}

.image{
    width: 90%;
    border-radius: 25px;
    border: solid 2px #B94E36
}

h1{
    margin-top: 30px;
    font-size: 46px;
    letter-spacing: 2px;
}

.text-container{
    margin-top: 30px;
    width: 80%;
    text-align: center;
    font-size: 22px;
    letter-spacing: 2px;
    line-height: 24px;
}

.button{
    margin-top: 40px;
    text-decoration: none;
    color: black;
    font-size: 1.6rem;
    background-color: #EBA550;
    border-radius: 25px;
    padding: 15px 50px;
    margin-bottom: 20px;
}

虽然 display:flex 对电子邮件客户端有很好的支持,但 flex-direction:row 却没有。因此,在您的示例中,flex-direction: column;align-items: center; 都将从 Outlook.com 或 iOS 和 Android 上的 Outlook 中删除,只留下默认值用display:flex(对应于flex-direction:rowalign-items:stretch)。

我建议使用另一种与电子邮件客户端更兼容的布局方法,例如 display:inline-block 或表格。