Solved

Coldfusion - using CSS in CFMAIL - specifically float:left

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jQuery scrollTop 2 41
iOS 10 iPad Zoom and acroll 4 54
Not showing page correctly 3 30
Error in script 11 46
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
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 a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
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 …

910 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now