Solved

Coldfusion - using CSS in CFMAIL - specifically float:left

Posted on 2014-01-15
3
786 Views
Last Modified: 2014-01-20
Coldfusion 9
MS Outlook 2007

I know that using CSS within Cfmail tags work best if used inline as opposed to a linked style sheet, therefore I have all my CSS inline.  I have tried both:

- type = "html" - in the cfmail tag
- <cfmailpart type="html">
- within 'body' and without these tags <html><head></head><body></body></html>

On my smart phone, all formatting seems to look fine.  When I open the email on Outlook 2007 it all looks good, except 'float:left' seems to be ignored.  

EXAMPLE:
<div style="color:##CC0000;float:left;">Company Name</div>
<div style="float:left;">#CompanyName#</div>
<div style="clear:left;"> </div>

DISPLAYS AS (In Outlook):
Company Name: (in red)
ABC Company

INSTEAD OF (My Blackberry):
Company Name: (in red) ABC Company

Am I missing something, or do I need to use a <table> in the Cfmail.

6Gun
0
Comment
Question by:MaxwellTurner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39784129
When it comes to email forget what you've been told about how bad tables are and use them and pretend div/span etc don't exist. Kinda IE1 web development (especially for Outlook which still uses Word for rendering)

https://litmus.com/blog/why-do-email-clients-render-emails-differently?utm_campaign=industry&utm_source=litmusblog&utm_medium=blog
0
 
LVL 16

Expert Comment

by:Gurpreet Singh Randhawa
ID: 39784976
please use tables for your emails, you will get whatever results you need, you can even specify a condition to detect if the email client is going to be outlook, use the tables else DIV

so my opinion use tables
0
 
LVL 1

Author Closing Comment

by:MaxwellTurner
ID: 39795102
Grrrrrr .... lol thanks for confirming this.  Guess I am re-designing the email.

Max
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question