Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML电子邮件中的背景图像_Html - Fatal编程技术网

HTML电子邮件中的背景图像

HTML电子邮件中的背景图像,html,Html,我只想添加背景图像,并想在上面写下文字。我什么都试过了。请给我完整的证明方法。 谢谢您可以尝试使用Z-index:只需在谷歌上搜索它关于Z-index:您可以在W3schools中获得在线示例 请参见此处:在电子邮件中提供图像时,链接应始终是相对路径 下面是一个电子邮件内容示例,说明我的意思 $content = '<div style="background:url(\'http://yourdomain.com/images/yourimage.jpg\');">';

我只想添加背景图像,并想在上面写下文字。我什么都试过了。请给我完整的证明方法。
谢谢

您可以尝试使用Z-index:只需在谷歌上搜索它关于Z-index:您可以在W3schools中获得在线示例


请参见此处:

在电子邮件中提供图像时,链接应始终是相对路径

下面是一个电子邮件内容示例,说明我的意思

$content = '<div style="background:url(\'http://yourdomain.com/images/yourimage.jpg\');">';
                                      //  ^ See the direct path to the image given here
$content .= "your text";
$content .= "</div>";
$content='';
//^查看此处给出的图像的直接路径
$content.=“您的文本”;
$content.=”;

因为它是一封电子邮件,所以最好尽可能使用老式的HTML,因为有些电子邮件阅读器不支持CSS

要在文本下获得背景,可以使用:

<table background="http://www.htmlcodetutorial.com/tables/deepsea.gif">


请参见此处的实时操作:

使用并应用背景图像,然后 为编写文本添加新的输入类型文本

像这样

<div style="background-image:url('imageurl') ">
  <your text box here>
</div>

祝你今天愉快。

@user1307242试试这个

<div> 
  <div style="position:absolute; z-index:-1">
    <img url='image path'/>
  </div>
  <div style="z-index:2">
    <Text box>
  </div>
</div>


“我什么都试过了。”告诉人们你试过了什么,最好是举个例子。Alredy试过了。bt在Outlook中仍然不起作用。Bt,非常感谢。@user1307242您记得在outlook中允许图像吗?出于安全原因,它将自动删除所有图像。见:。。。由于这种方式是老式的HTML outlook应该没有问题,如果允许下载图像:)谢谢..但不幸的是,outlook不支持背景图像。是的,我只使用相对路径。。我想在图像上写文字。你知道怎么做吗???@user1307242,如果你使用上面的代码,
你的文本将出现在背景div的正上方。