Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.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
Php 如何更改以下行的css?_Php_Css - Fatal编程技术网

Php 如何更改以下行的css?

Php 如何更改以下行的css?,php,css,Php,Css,有一个$message变量。在这个变量中,发生了字符串连接。我想在这个变量上使用CSS,我知道这是可能的。但是我尝试了很多内联CSS,但是没有结果。请在这件事上帮忙。谢谢 $message = __( 'Someone requested that the password be reset for the following account:' ) . "\r\n\r\n"; $message .= network_home_url('/') . "\r\n\r\n"; $messag

有一个$message变量。在这个变量中,发生了字符串连接。我想在这个变量上使用CSS,我知道这是可能的。但是我尝试了很多内联CSS,但是没有结果。请在这件事上帮忙。谢谢

$message  = __( 'Someone requested that the password be reset for the following account:' ) . "\r\n\r\n";   
$message .= network_home_url('/') . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user_login). "\r\n\r\n";
$message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "\r\n\r\n";  $message .= __('To reset your password, visit the following address:') . "\r\n\r\n";
$message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login="
  .rawurlencode($user_login), 'login') . ">\r\n";
$message=\u('有人请求为以下帐户重置密码:')。“\r\n\r\n”;
$message.=网络\主页\ url('/')。“\r\n\r\n”;
$message.=sprintf(\uuuu('Username:%s'),$user\u login)。“\r\n\r\n”;
$message.=\uuuu('如果这是一个错误,请忽略此电子邮件,将不会发生任何事情')。“\r\n\r\n”$message.=\uuuu('要重置密码,请访问以下地址:')。“\r\n\r\n”;

$message.='您可以将其放在HTML标记中,并提供一个样式或类属性来实现这一点

$message = '<div class="theMessage" style="font-family:Helvetica;color:RED;">Something goes here</div>';
$message='Something goes here';

别忘了关上单门和双门。但我的猜测是,你的问题不是PHP,而是Wordpress的问题。

如果你试图用PHP或其他技术发送电子邮件,你必须定义你的内容类型html。在php中,我们使用下面的代码发送Html消息

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
你们可以从下面的链接中得到想法


不要使用内联css。指定一个类,并在CSSnot中定义该类,同时使用类。甚至文本“Someone…”也会打印出来。