I know how to use the CSS property "display: block" on an anchor to get it to make an entire cell clickable. However, this doesn't seem to work within an HTML email. Any ideas on how to get this to work in an email?
Thanks!
I know how to use the CSS property "display: block" on an anchor to get it to make an entire cell clickable. However, this doesn't seem to work within an HTML email. Any ideas on how to get this to work in an email?
Thanks!
I would put a TABLE
element inside the anchor element, with width=100%
and push the anchor out to fill its container from within.
Many email clients strip out css styles from the head and they don't work, so you have to use inline styles (ie putting <a style="display:block;">
etc).
Taken from this solution
display: block
in the links works for everything but IE/Windows. If you give the block an explicit width of 100%, then IE/Windows plays along. But doing this creates problems with IE5/Mac and Netscape/Mozilla. So you have to use the child selector“>” to redefine the width to auto. Since IE/Windows doesn’t understand child selectors, it ignores the rule. IE5/Mac, Opera and Netscape/Mozilla follow the rule, and everyone is happy:
#yourdiv a {
display: block;
width: 100%;
}
html>body #yourdiv a {
width: auto;
}