Mattattack Mattattack - 1 month ago 8
CSS Question

CSS/HTML custom button IFTTT click event

I am trying to make a button that fires an email using IFTTT, I have coded a button using a class that draws out the button on the website, when it is clicked, nothing happens.

First name:<br>
<input type="text" name="value1"><br>
Last name:<br>
<input type="text" name="value2">
<div class="button">
<!--Send E-Mail!-->
<button name="sendmailbutton" value="send email">Send E-Mail</button>
</div>




.button {
background-color: #00FFFF;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
border-radius: 2px;
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
}

.button:hover {
background-color: #008b8b;
color: white;

Answer

The problem was, at-least my problem; the HTML/CSS that you had for the <div> element that was containing the <button> was simply pushing the <button> into the center, meaning you could click the <div> but you were not actually focusing/activating the button.

Take a look here (I have removed the key for obvious reasons);

http://plnkr.co/edit/MV075bPS4Oq0dOKrT2vG?p=preview

CSS;

.my-button-css {
    background-color: #00FFFF; 
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    border-radius: 2px;
    -webkit-transition-duration: 0.4s; 
    transition-duration: 0.4s;
}

.my-button-css:hover {
    background-color: #008b8b; 
    color: white;
}

HTML;

<form action="https://maker.ifttt.com/trigger/web_button_pressed/with/key/" method="post">
    First name:<br>
    <input type="text" name="value1"><br>
    Last name:<br>
    <input type="text" name="value2">
    <!--Send E-Mail!-->
    <button class="my-button-css" name="sendmailbutton" value="send email">Send E-Mail</button>
</form>