html - How to right align images for responsive email with empty space to the left -
i'm aiming right align 4 social icons in header of email. mock , code below. main issue i've run there empty space left side of icons. empty td width pushes set of images outside of viewable area @ small screen sizes.
ideally icons right:0; or floated right. although know float avoided in email.
mock up: http://i.stack.imgur.com/9o1j1.png
the code below stacks social icons directly beneath logo on left side of table.
<table align="center" border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td> <!-- header content --> <table align="center" border="0" cellspacing="0" cellpadding="0" width="600"> <tr> <td align="left" style="display:inline-block"> <img src="logo.png" alt="logo" style="display:block; padding-top:32px; font:300 16px/24px arial, sans-serif; color:#000;" width="286"/> </td> </tr> <tr> <td style="display:inline-block; padding-top:4px; padding-bottom:14px;"> <a href="#" style="display:inline-block; text-decoration:none; padding-right:10px;"><img src="social-fb.png" alt="fb" width="18" /></a> <a href="#" style="display:inline-block; text-decoration:none; padding-right:10px;"><img src="social-blog.png" alt="blog" width="18" /></a> <a href="#" style="display:inline-block; text-decoration:none; padding-right:10px;"><img src="social-twitter.png" alt="twitter" width="18" /></a> <a href="#" style="display:inline-block; text-decoration:none;"><img src="social-linkedin.png" alt="linkedin" width="18" /></a> </td> </tr> </table> </td> </tr>
you can align <td>
contains social buttons right.
this supported in email clients including lot of mobile clients. ran code through email on acid , supported in major desktop clients except thunderbird , mobile clients except android , ios gmail app.
<table align="center" border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td><!-- header content --> <table align="center" border="0" cellspacing="0" cellpadding="0" width="600"> <tr> <td align="left" style="display:inline-block"><img src="logo.png" alt="logo" style="display:block; padding-top:32px; font:300 16px/24px arial, sans-serif; color:#000;" width="286"/></td> </tr> <tr> <td align="right" style="display:inline-block; padding-top:4px; padding-bottom:14px;"><a href="#" style="display:inline-block; text-decoration:none; padding-right:10px;"><img src="social-fb.png" alt="fb" width="18" /></a> <a href="#" style="display:inline-block; text-decoration:none; padding-right:10px;"><img src="social-blog.png" alt="blog" width="18" /></a> <a href="#" style="display:inline-block; text-decoration:none; padding-right:10px;"><img src="social-twitter.png" alt="twitter" width="18" /></a> <a href="#" style="display:inline-block; text-decoration:none;"><img src="social-linkedin.png" alt="linkedin" width="18" /></a></td> </tr> </table></td> </tr> </table>
Comments
Post a Comment