views:

156

answers:

2

I'm creating a newsletter, and i want to have panels that change background-color on mouse over.
Seeing as the newsletter wont have a head, I am defining all styles inline. I'm pretty sure most popular mail clients will block JS. So I was wondering if I can define a hover effect in the style attribute. Or is there any other solution to achieve this effect?
Peace

A: 

I you are certain your css will not be removed, you can use a hover and a background-color property

.panel:hover {
    background-color: #EFEFEF;
}

Also it does not seem possible to use a pseudo-selector in an inline style, so that might be a stopper:

nc3b
I am certain the CSS is removed, i've been testing a lot
Moak
A: 
<style>
.panel
{
  display: block;
  text-decoration: none;
  color: #111;
  background: #eee;
}
.panel:hover
{
  display: block;
  text-decoration: none;
  color: #111;
  background: #ccc;
}
</style>
<div class="panel" href="#">Newsletter panel content</div>
Gabriel
This gets striped....
Moak
yeah, your email client may not be able to do it. It is always a crapshoot. I use gmail and never get the intended email result. But I don't mind, if I actually care what the newsletter says I follow the link to the website and read it from there.
Gabriel