Conflict with ids and classes in webmail clients css

When I create a CSS-styled email, I do a couple of things. I always try to keep the entire message wrapped in a div with a unique name, so that I can create rules that match my specific content.  Within that div, I attempt to "reset" things. But all too frequently, some CSS used to style the shell of the webmail client interferes with my styling.

I thought the reset generally worked, but comcast's webmail got me today because I used have a div with an id of "content" and comcast has

   #content { margin: 0 0 0 157px !important; }

and the !important nailed me.

Do I need to make my id and classes unique so that they never collide? Or am I missing something?

e.g.,   STheader, STfooter, STcontent, etc.


Stig Stig, 9 years ago

Hi Mark,
you basically got the solution yourself :) Use something you can be sure nobody else will be using.


The Campaign Monitor Blog – HTML email smarts to go with your good looks.
MarkS, 9 years ago

Thanks Stig. I appreciate the reply.

200,000 companies around the world can't be wrong.

From Australia to Zimbabwe, and everywhere in between, companies count on 
Campaign Monitor for email campaigns that drive real business results.

Get started for free