Solved

Coldfusion - using CSS in CFMAIL - specifically float:left

Posted on 2014-01-15
3
800 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

AWS Certified Solutions Architect - Associate

This course has been developed to provide you with the requisite knowledge to not only pass the AWS CSA certification exam but also gain the hands-on experience required to become a qualified AWS Solutions architect working in a real-world environment.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
Suggested Courses

636 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