SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Inline Declarations for email marketing

    I'm coding an email announcement. Normally, I use an attached style sheet, and sometimes I opt for embedded CSS in the head of the document. However, I'm trying to bypass some of the support issues w/ the recipients' browsers and email clients by using inline declarations, and I have what seems to be a basic question but one I can't really find discussed anywhere:

    When using and inline declaration, if you are using a class vs. an ID selector, must you indicate that in the inline declaration? Meaning, do you have to put "class" or are you fine simply using the "style" tag? Also, is it possible to use a pseudo-class selector inline? Specifically, if I wanted a link to change colors when rolled over, how would I code this using an inline declaration?

  2. #2
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    967
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    In HTML emails, you can put the style sheet in the body so it doesn't get stripped out. You can also use inline styles. Classes and divs are ok, but Id recommend a table layout. You just don't want to there with a CSS layout.
    Michael

  3. #3
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I ended up using inline style declarations in my divs. However, my pseudo class selectors were dropped, since I wasn't sure how to code this to get the rollover effect, so thus no rollover links... Normally, I'd have it in a separate CSS file linked up to the HTML file, but I'm not sure how to instruct text to rollover using an inline declaration. Despite this, the main formatting (size of divs, etc.) seems to hold up, but I lost the rollovers, and also the backgrounds.

    I'm using Constant Contact, and it looks great when I preview it w/ the css embedded in the head of the doc, but when the email goes out to the inboxes of the various members of the organization, it's a different story.

    Thanks for your suggestions: I had always wondered why so many marketing emails still use tables, and now I know I guess I'll have to go back to table based layouts for most of these

  4. #4
    SitePoint Evangelist Karpie's Avatar
    Join Date
    Jul 2007
    Location
    Perth, Australia
    Posts
    445
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't use CSS embedded anywhere other than inline. Different e-mail clients will strip out CSS placed in different places, the only safe place to put it so that it will definitely stay in your e-mail is inline.

    A great reference for coding emails:
    http://www.campaignmonitor.com/blog/...in_emai_2.html

  5. #5
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Karpie, thank you for the reference link. I have book-marked this page, and this will be of great value for future campaigns.

    Much appreciated.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •