foundation-emails icon indicating copy to clipboard operation
foundation-emails copied to clipboard

Only the text within buttons is clickable

Open samglover opened this issue 12 years ago • 7 comments

The CSS for buttons results in a nice, graphical button, but only the text is clickable. The rest of the button is just for looks. Here's one way to fix it:

table.button td a,
table.tiny-button td a,
table.small-button td a,
table.medium-button td a,
table.large-button td a {
  display: block;
  height: 100%;
  width: 100%;
}

Making the a element expand to fill the td container results in a fully-clickable button.

samglover avatar May 22 '14 01:05 samglover

I've been trying this out, it makes buttons that behave like buttons across most email clients, especially outlook

http://buttons.cm/

so far so good

erikflowers avatar May 22 '14 02:05 erikflowers

Thank you! I noticed the same issue and your suggested code worked beautifully! This should be merged into the master.

KBischof avatar Sep 21 '14 17:09 KBischof

Odd, I noticed that the official documentation has the suggested width and block settings added to the buttons, but the latest version of Ink v1.0.5 doesn't have the changes. So now the official documentation is inconsistent with the release.

davidklebanoff avatar Feb 23 '15 04:02 davidklebanoff

Take out the padding from the button css so your button is the height of your text. Then in your button href css add:

line-height: 3.6em;
display: inline-block;
width: 100%;

lancesells avatar Jun 15 '15 19:06 lancesells

Does anyone have any insight on how compatible this approach is? I've understood that Outlook doesn't deal too well with block-level links.

There are a number of ways that claim to work across clients, (like buttons.cm mentioned above, or this article from Litmus), but few of them are responsive. It would be fantastic if we could come up with a variation that could be made part of Ink.

lime avatar Jul 09 '15 06:07 lime

@samglover for your solution --> :+1:

niyando avatar Feb 24 '16 11:02 niyando

We've addressed the button issues in v2. We chose to pursue the hybrid approach of padding and borders, making the clickable area much larger. We're no longer supporting v1, however we're more than happy to merge a PR into the v1.0.0 branch!

tdhartwick avatar May 02 '16 22:05 tdhartwick