如何避免Web浏览器中不需要的字体大小更改 [英] how to avoid unwanted fontsize change in web browser

查看:108
本文介绍了如何避免Web浏览器中不需要的字体大小更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个控制台C#程序,它将电子邮件发送给用户,并将图像嵌入到邮件正文中。我已经推荐这个链接来编写程序

http://www.codeproject.com/Articles/34467/Sending-Email-Using-Embedded-Images



在电子邮件正文中,我提到字体大小为

I have a written a console C# program, that send email to the users with the image embedded into the body of mail. I have referred this link to write the program
http://www.codeproject.com/Articles/34467/Sending-Email-Using-Embedded-Images

In the email body, I have mentioned the font size as

"10" and image alignment as "middle"
string body = "<html><body><b><font size=\"10\" face=\"Helvetica\" color=\"B0B0B0\">Some Text</font></b><br><br><img align=\"middle\" src=\"cid:Pic1\"></body></html>";



但是当用户在他们的Outlook中收到邮件时,正文的字体大小显示为36并且图片无法显示电子邮件正文正文的中心。



请建议,如何解决这个问题。


but when the mail is received by the users in their outlook, the fontsize of the body is appears as 36 and the picture doesn't get to the center of the body of the email message body.

Kindly suggest, how to overcome this issue.

推荐答案

你指定的大小 e font tag是1到7之间的数字,其中3是浏览器(在本例中为邮件客户端)的默认值。 HTML 5也不支持此属性,应避免使用。另请参见 w3schools [ ^ ]。



最好使用样式标记而不是字体标记,例如

The size you specify in the font tag is a number from 1 to 7, where 3 is the default of the browser (or mail client in this case). This attribute is also not supported in HTML 5 and should be avoided. See also w3schools[^].

It's better to use the style tag instead of the font tag, e.g.
<b style="font-size: 10px; font-family: 'Helvetica'; color: #B0B0B0;">some text</b>





不确定图片的交易是什么,你必须在邮件的标题中用正确的名称发送。



Not sure what the deal is with the picture, you do have to send it with in the header of the mail with the correct name.


创建一个单独的模板,按照自己的方式设计并填充动态LLY。这样你的CSS就能正确应用。
Create a separate template, design it in your way and fill it dynamically. So that your CSS will apply properly.


这篇关于如何避免Web浏览器中不需要的字体大小更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆