简体   繁体   中英

How can I write a text on a picture in an e-mail (inline css)

I create an html design in mail this code works in any browser but I try email design but it doesn't work. Can you help me?

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:o="urn:schemas-microsoft-com:office:office">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1">
        <meta name="x-apple-disable-message-reformatting">
    </head>

<body>
    <div style="position: absolute;">
        <img style="position: static; width: 550px;"
             src="imageUrl" alt="sss"/>
    </div>
    
    <h1 style="position: absolute; color: black; margin-top: 120px; margin-left: 150px;">Person name</h1>
</body>

</html>

I've tried;

table background and body background. Doesn't work.

I need to show my image and text. But it's not working. It just shows my text. Actually the css code works, but the image looks separate image. Text should appear on the picture.

I tried multiple methods. Gmail, Outlook etc. I've seen mail providers block css codes. Thanks for the comment. That's why I'm going to use simple backgrounds.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM