首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >html电子邮件签名以调整iphone/小屏幕的大小

html电子邮件签名以调整iphone/小屏幕的大小
EN

Stack Overflow用户
提问于 2015-09-27 00:53:44
回答 1查看 1.1K关注 0票数 0

我正在设计一个基本的HTML签名。我在Dreamweaver (Mac)中编写HTML代码,在firefox/safari中打开预览,然后选择all并将HTML拖到苹果邮件签名编写器中。它工作得很好,这个签名在桌面和ipad上看起来不错,但在iphone/更小的屏幕上却不起作用。

签名看起来是这样的(我已经把个人细节弄黑了):

问题是在较小的iphone上,一些文本保留在图片的左边,而另一些则不适合在照片下面,但有一个边距。最理想的是,如果在iphone上,我可以配置,所有文本和图标都显示在主图片下面,没有边框。是否可以在HTML电子邮件中为iphone设置不同的CSS样式?或者还有其他方法可以让我的代码更有响应性呢?

代码语言:javascript
运行
AI代码解释
复制
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Untitled Document</title>


</head>
<body>

 <div id="sig-container" style="margin-top: 15px;padding-top: 6px; border-top: 1px dashed #ddd;">
 <div style="float: left; margin: 2px 10px 5px 0px; border-right: 2px solid #000; padding-right: 30px; display: block;" id="photoWrapper"> <img src="http://websiteremoved/emailsm.jpg" id="sigPhoto" height="300px" width="200px"> </div> 
 <div style="margin-top:0px; margin-left: 74px;" id="sigDetailsWrapper"> <p style="font-family: Arial, sans-serif; font-size: 20px; line-height: 10px; color: #333; margin-top:10; margin-left:0; padding-left:0;"> <strong><span id="sigName">Name Removed</span></strong></span> <br>
 <span id="sigTitle"><p style="font-family: Arial, sans-serif; font-size: 16px; line-height: 0px; color: #333; margin-top:0; margin-bottom:20px;margin-left:0; padding-left:0;">Title Removed | Title Removed</span><br> 
 <div><p style="font-family: Arial, sans-serif; font-size: 16px; line-height: 20px; color: #333;">
 <span> email: <a href="mailto:emailremoved" id="sigEmail" style="color:#428BCA; text-decoration: none;">emailremoved </a></span> <br>
  <span> mobile: <a href="tel:mobileremoved" id="sigMobile" style="color:#428BCA; text-decoration: none;">mobileremoved </a></span><br>
  <span> web:  <a href="http://websiteremoved" id="sigWebsite" style="color:#428BCA; text-decoration: none;"   rel="nofollow">websiteremoved</a></span> <br>
 <span>  facebook: <a href="http://facebook.com/facebookremoved" id="sigfb" style="color:#428BCA; text-decoration: none;"  rel="nofollow">facebook.com/facebookremoved</a></span> <br> <br>
  <a href="tel:phonenumberremoved"><img src="http://websiteremoved/phone.jpg" height="62px" width="62px" style="color:#428BCA; text-decoration: none;"  rel="nofollow"></a>
  <a href="http://websiteremoved/fb.jpg" height="62px" width="62px" style="color:#428BCA; text-decoration: none;"  rel="nofollow"></a>
  <a href="mailto:emailremoved"><img src="http://websiteremoved/email.jpg" height="62px" width="62px" style="color:#428BCA; text-decoration: none;"  rel="nofollow"></a>
  <a href="http://websiteremoved"><img src="http://websiteremoved/web.jpg" height="62px" width="62px" style="color:#428BCA; text-decoration: none;"  rel="nofollow"></a>  </p> </div>  

<div class="sep about" style="box-sizing: border-box;
background-attachment: scroll; height: 120px; position: relative; 
-webkit-background-size: cover; background-size: cover; 
background-image: 
url('http://websiteremoved/about-sep.jpg');
 z-index: 1; background-position: 50% -48.5px; background-repeat: 
no-repeat no-repeat; "></div>

</div>

</body>
</html>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-09-28 13:49:07

是的,你可以用他们的视网膜屏幕瞄准iPhones。媒体查询应该是"@media和(min-设备-像素比: 1.5)“,例如.

代码语言:javascript
运行
AI代码解释
复制
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Untitled Document</title>
<style type="text/css">
@media all and (min-device-pixel-ratio : 1.5) { 
    #sigDetailsWrapper {margin-left: 0px !important;}
}
</style>
</head>
<body>

 <div id="sig-container" style="margin-top: 15px;padding-top: 6px; border-top: 1px dashed #ddd;">
 <div style="float: left; margin: 2px 10px 5px 0px; border-right: 2px solid #000; padding-right: 30px; display: block;" id="photoWrapper"> <img src="http://websiteremoved/emailsm.jpg" id="sigPhoto" height="300px" width="200px"> </div> 
 <div style="margin-top:0px; margin-left: 74px;" id="sigDetailsWrapper"> <p style="font-family: Arial, sans-serif; font-size: 20px; line-height: 10px; color: #333; margin-top:10; margin-left:0; padding-left:0;"> <strong><span id="sigName">Name Removed</span></strong></span> <br>
 <span id="sigTitle"><p style="font-family: Arial, sans-serif; font-size: 16px; line-height: 0px; color: #333; margin-top:0; margin-bottom:20px;margin-left:0; padding-left:0;">Title Removed | Title Removed</span><br> 
 <div><p style="font-family: Arial, sans-serif; font-size: 16px; line-height: 20px; color: #333;">
 <span> email: <a href="mailto:emailremoved" id="sigEmail" style="color:#428BCA; text-decoration: none;">emailremoved </a></span> <br>
  <span> mobile: <a href="tel:mobileremoved" id="sigMobile" style="color:#428BCA; text-decoration: none;">mobileremoved </a></span><br>
  <span> web:  <a href="http://websiteremoved" id="sigWebsite" style="color:#428BCA; text-decoration: none;"   rel="nofollow">websiteremoved</a></span> <br>
 <span>  facebook: <a href="http://facebook.com/facebookremoved" id="sigfb" style="color:#428BCA; text-decoration: none;"  rel="nofollow">facebook.com/facebookremoved</a></span> <br> <br>
  <a href="tel:phonenumberremoved"><img src="http://websiteremoved/phone.jpg" height="62px" width="62px" style="color:#428BCA; text-decoration: none;"  rel="nofollow"></a>
  <a href="http://websiteremoved/fb.jpg" height="62px" width="62px" style="color:#428BCA; text-decoration: none;"  rel="nofollow"></a>
  <a href="mailto:emailremoved"><img src="http://websiteremoved/email.jpg" height="62px" width="62px" style="color:#428BCA; text-decoration: none;"  rel="nofollow"></a>
  <a href="http://websiteremoved"><img src="http://websiteremoved/web.jpg" height="62px" width="62px" style="color:#428BCA; text-decoration: none;"  rel="nofollow"></a>  </p> </div>  

<div class="sep about" style="box-sizing: border-box;
background-attachment: scroll; height: 120px; position: relative; 
-webkit-background-size: cover; background-size: cover; 
background-image: 
url('http://websiteremoved/about-sep.jpg');
 z-index: 1; background-position: 50% -48.5px; background-repeat: 
no-repeat no-repeat; "></div>

</div>

</body>
</html>

不过,您可能需要对其进行重新编码,以使用表,因为div在Outlook中经常会被弄乱,而且还会出现浮点。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32806182

复制
相关文章
在Node.js中读写文件
本文翻译自Reading and Writing Files in Node.js
ccf19881030
2020/10/29
5.3K0
JS动态添加/删除css文件
Jensen_97
2023/07/20
7590
在Node.js中处理Zip文件
Zip 文件是常用的压缩文件格式。在本文中,我将演示如何用 adm-zip npm 模块[1]创建和提取 zip 文件。
疯狂的技术宅
2020/08/10
5.2K0
js中find的用法_js中find函数
首先简单的介绍一下ES6是什么,可能很多人还是第一次听说,我们都知道H5是html的新一代的标准,同样,ES6是javascript的新一代标准,全称是ECMAScript 6.0,简称ES6,其实不是什么神秘的东西。15年6月发布的。
全栈程序员站长
2022/11/04
11.8K0
js中的函数
console.log(fn instanceof Object) // 是Object类型的实例
李才哥
2020/08/17
6.6K0
js中的函数
js中的函数
console.log(fn instanceof Object) // 是Object类型的实例
李才哥
2020/03/28
5.4K0
js中的函数
JS中工厂函数
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <script> //工厂函数是专门创建对象的函数 function createPersion(myname,myage) { let obj=new Object(); obj.name=myname; obj.age=myage; obj.say=functi
贵哥的编程之路
2020/10/28
1.5K0
js中的匿名函数_js匿名函数怎么定义
定义:匿名函数顾名思义指的是没有名字的函数,在实际开发中使用的频率非常高!也是学好JS的重点。
全栈程序员站长
2022/11/10
10.4K0
js函数中使用el表达式传入多个参数时的问题
需求是需要使用js函数执行给某个div标签赋值,但是当传入id和title时就不能进入js中,尝试很久才明白title属于字符串,需要使用引号,但是不确定怎么加,多番调试终于通过了,如下: οnclick="delete1({news.id},{news.title}’);return true;"
geekfly
2022/05/06
2K0
用函数式编程在 JS 中开发游戏
一段时间以来,函数式编程范式比较火热,并且在互联网上有很多关于它的精彩书籍和文章,但是要找到相关程序的真实示例并不容易。因此,我决定尝试使用 Javascript(当今最流行的编程语言)并遵循其概念创建一款游戏。在本文中,我将分享一些经验,并告诉你是否值得。
疯狂的技术宅
2020/03/13
2.2K0
在Node.js中如何逐行读取文件
本文翻译自How to read a file line by line in Node.js
ccf19881030
2020/10/29
13.8K0
js 复制粘贴文章时添加版权信息
<script>        function setClipboardText(event){         event.preventDefault();         var node = document.createElement('div');               node.appendChild(window.getSelection().getRangeAt(0).cloneContents());                var htmlData = '<div>'  
Savalone
2020/02/11
1.3K0
JS中递归函数 18
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <bo
贵哥的编程之路
2020/10/28
2.1K0
html js 数组添加,js数组添加数据
我们在学习python的过程中,会对列表、字符串添加数据。在Javascript中,我们也会对数组添加数据。在不同的位置添加数据有着不同的方法。本文介绍js数组添加数据的三种方法:1、结尾添加push()方法;2、头部添加unshift() 方法;3、向/从数组指定位置添加/删除项目,然后返回被删除的项目splice() 方法。
全栈程序员站长
2022/07/01
26.5K0
JS中的运动函数
分享一个JS封装的运动函数,里面分为弹性运动和缓冲运动两个方法,通过调用startMove()函数来实现动画效果。
越陌度阡
2020/11/26
2.4K0
JS中的高阶函数
在js的内置对象中同样存在着一些高阶函数,像数组的map,filter,reduce方法等,它们接受一个函数作为参数,并应用这个函数到列表的每一个元素
小丞同学
2021/08/16
1.4K0
JS中添加元素的方法
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/152078.html原文链接:https://javaforall.cn
全栈程序员站长
2022/06/25
9.8K0
JS中添加元素的方法
在Koa.js中实现文件上传的接口
文件上传是一个基本的功能,每个系统几乎都会有,比如上传图片、上传Excel等。那么在Node Koa应用中如何实现一个支持文件上传的接口呢?本文从环境准备开始、最后分别用 Postman 和一个HTML页面来测试。
张张
2019/12/27
4.9K0
在Node.js中逐行读取文件【纯技术】
在计算机科学中,文件是一种资源,用于在计算机的存储设备中离散地记录数据。Node.js不会以任何方式覆盖它,并且可以与文件系统中被视为文件的任何文件一起使用。
Jean
2019/09/24
7.9K0
vue文件中引入js_vue中require引入js
由于一些演示,需要对编码名称等可快速进行修改,需要页面方便配置。由于build后的vue项目基本已经看不出原样,因此需要创建一个文件,并在打包的时候不会进行编译。
全栈程序员站长
2022/11/08
12.2K0

相似问题

在cygwin/mingw上编译windows

12

glog不使用MinGW在Windows上编译

16

用OpenCV在Windows上编译MinGW

22

用QJson在Windows上编译MinGW

14

帮助使用GTK+在Windows上编译MinGW

13
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档