我正在为iOS设备制作电子邮件简报,并希望控制字体大小,以避免我的布局因默认字体大小而崩溃。
我尝试了以下但是它不起作用。但是,当我从表中取出段落标记时,它可以工作。有人可以帮忙吗?谢谢!
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<title>Untitled Document</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<style type='text/css'>
body { -webkit-text-size-adjust: 100%; }
</style>
</head>
<body>
<table cellpadding='0' cellspacing='0' border='0' style='-webkit-text-size-adjust:100%;'>
<tr>
<td>
<p style='-webkit-text-size-adjust:100%; font-family:Arial, sans-serif; font-size:13px;'>This paragraph is 13px.</p>
<p style='-webkit-text-size-adjust:100%; font-family:Arial, sans-serif; font-size:12px;'>This paragraph is 12px.</p>
<p style='-webkit-text-size-adjust:100%; font-family:Arial, sans-serif; font-size:11px;'>This paragraph is 11px.</p>
<p style='-webkit-text-size-adjust:100%; font-family:Arial, sans-serif; font-size:10px;'>This paragraph is 10px.</p>
<p style='-webkit-text-size-adjust:100%; font-family:Arial, sans-serif; font-size:9px;'>This paragraph is 9px.</p>
<p style='-webkit-text-size-adjust:100%; font-family:Arial, sans-serif; font-size:8px;'>This paragraph is 8px.</p>
<p style='-webkit-text-size-adjust:100%; font-family:Arial, sans-serif; font-size:7px;'>This paragraph is 7px.</p>
<p style='-webkit-text-size-adjust:100%; font-family:Arial, sans-serif; font-size:6px;'>This paragraph is 6px.</p>
<p style='-webkit-text-size-adjust:100%; font-family:Arial, sans-serif; font-size:5px;'>This paragraph is 5px.</p>
</td>
</tr>
</table>
</body>
</html>
答案 0 :(得分:0)
在选择器中添加 p ,并删除所有<p>
元素中的内联text-size-adjust属性。
body p { -webkit-text-size-adjust: 100%; }