Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does font-size CSS not work on iPad HTML emails?

I'm working on an HTML email and have been running to a problem on the mail client on the iPad only.

It seems that setting inline CSS to "font-size: 12px" or any other size does not work on the mail app for iPad, despite the font-size displaying correctly in the Mail app for Mac OS X.

Any ideas?

like image 917
Pin Avatar asked Aug 04 '10 07:08

Pin


People also ask

How do I change the font size on my IPAD incoming emails?

Larger Text: Turn on Larger Accessibility Sizes, then adjust the text size using the Font Size slider. This setting adjusts to your preferred text size in apps that support Dynamic Type, such as Settings, Calendar, Contacts, Mail, Messages, and Notes.

Why is my font size not changing in HTML?

Go to your browser's settings and make sure in the font settings that your minimum font setting is set to 10px… if not then change it, save & go back to the code. It should pass you then!

How do I change the font size in HTML CSS?

To change the font size in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property font-size. HTML5 do not support the <font> tag, so the CSS style is used to add font size.

How do I fix text size in HTML?

In HTML, you can change the size of text with the <font> tag using the size attribute. The size attribute specifies how large a font will be displayed in either relative or absolute terms. Close the <font> tag with </font> to return to a normal text size.


2 Answers

Webkit automatically adjusts font-sizes on the ipad for easy reading. This CSS fixes the problem:

-webkit-text-size-adjust: none;
like image 176
Pin Avatar answered Oct 02 '22 15:10

Pin


The WebKit layout engine automatically adjusts font-sizes.
As of this post, Webkit is commonly used in Safari, Chrome, Kindle and Palm Browsers.
Applications can also take advantage of WebKit.

The problem comes down to minimum 'font-size: 13px;'

A CSS work-around:
<style type="text/css">
div, p, a, li, td { -webkit-text-size-adjust:none; }
</style>



One issue is when creating e-Mail Signatures, for tags may be over-written or stripped.
Please Note that inline WebKit Styling will be stripped out of Gmail's Web Client.

like image 34
Trenton Bost Avatar answered Oct 02 '22 16:10

Trenton Bost