@media queries being ignored for iphone
html-email, media-queries
Solution
Unfortunately, gmail does not support media queries (See http://www.emailonacid.com/blog/details/C13/media_queries_in_html_emails), although many do. Your best bet is to design first without media queries, and use some regular CSS to get columns to stack etc, accepting the fact that your design won't look perfect everywhere, but will still be accessible. Then you can add some media query magic to make it look fantastic on every client that supports it. See http://www.zurb.com/article/1119/create-emails-for-any-device-introducing- for a good example of such an approach, and http://www.zurb.com/playground/responsive-email-templates for some basic templates to get you up and running.
Problem
For some reason, my media query is not applying when I send my email. I'm sending it from Outlook 2007 to a gmail and viewing it using an iphone 4s. I've tried sending test emails with simpler @media query rules (i.e. a media query that just changes the font color) but those don't work either. Also, I've tried sending demo html emails from tutorials (such as this one: http://www.netmagazine.com/tutorials/build-responsive-emails) but the media queries are also being ignored there I've attached the beginning of my code below: ``` <!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"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <title>Sample</title> <style type="text/css"> @media only screen and (max-width: 480px) { table[class="contenttable"] { width:400px !important; text-align: left !important; } table[class="contenttable2"] { width: 382px !important; text-align: left !important; } td[class="changer"] { width:382px !important; height: 10px !important; } td[class="autoalign"] { padding: 0 !important; text-align: center !important; } img[class="logo"] { margin-left: -10px !important; } td[class="autotext"] { font-size: 14px !important; text-align:left !important; height: 70px !important; } td[class="textresize"] { font-size: 8px !important; } img[class="imgHide"] { display:none !important; height:0 !important; width:0 !important; } } </style> </head> <body style="padding:0; margin:0; webkit-text-size-adjust:none;-ms-text-size-adjust: 100%;"> <table width="600" border="0" cellpadding="0" cellspacing="0" class="contenttable" align="center" style="font-family: Arial;"> ``` I'm at a complete loss what the problem is. Any help would be greatly appreciated.