如何将按钮链接到电子邮件地址

时间:2016-02-17 13:04:18

标签: html

我有一个按钮(用CSS设计)。 HTML看起来像这样:

button1

现在我想将按钮链接到电子邮件地址。以下解决方案无效。它将电子邮件地址(email@email.de)显示为按钮中的文本。

<div class="button">Kontakt</div> 

并且div容器作为内部HTML元素的解决方案也不起作用:

<div class="button"><a href="mailto:email@email.de">Kontakt</a></div> 

关于我如何在按钮上显示“Kontakt”一词以及链接到电子邮件地址的任何想法?

5 个答案:

答案 0 :(得分:1)

只需写下

Dim view As String = "select * from tblhistory where accountnumber = '" 
    & 
txtAccount.Text & "' and date between '" & txtFrom.Text & "' and '" & txtTo.Text & "'"

答案 1 :(得分:1)

简单的解决方案是用一个元素包裹按钮。

<a href="mailto:email@email.de">
<button class="button">Kontakt</button>
</a>

答案 2 :(得分:0)

&#13;
&#13;
.btn {
  background: #3498db;
  background-image: -webkit-linear-gradient(top, #3498db, #2980b9);
  background-image: -moz-linear-gradient(top, #3498db, #2980b9);
  background-image: -ms-linear-gradient(top, #3498db, #2980b9);
  background-image: -o-linear-gradient(top, #3498db, #2980b9);
  background-image: linear-gradient(to bottom, #3498db, #2980b9);
  -webkit-border-radius: 28;
  -moz-border-radius: 28;
  border-radius: 28px;
  font-family: Arial;
  color: #ffffff;
  font-size: 20px;
  padding: 10px 20px 10px 20px;
  text-decoration: none;
}

.btn:hover {
  background: #3cb0fd;
  background-image: -webkit-linear-gradient(top, #3cb0fd, #3498db);
  background-image: -moz-linear-gradient(top, #3cb0fd, #3498db);
  background-image: -ms-linear-gradient(top, #3cb0fd, #3498db);
  background-image: -o-linear-gradient(top, #3cb0fd, #3498db);
  background-image: linear-gradient(to bottom, #3cb0fd, #3498db);
  text-decoration: none;
}
&#13;
<a class="btn" href="mailto:email@email.co">Get In Touch</a>
&#13;
&#13;
&#13;

答案 3 :(得分:0)

只需在您的HTML文件中写下

即可
<a href="mailto:email@email.de">Kontakt</a>

并为css添加以下内容

a {
    text-decoration: none; /* to hide the underline */
}
a:visited {
    /* this will style the button after clicking for example the color of the text */
    color: white; /* change it to the text color in your normal style */
}
a:hover {
    /* the style here will appear when the mouse is over the button */
    /* this will help you to make it act like a real button */
}

或将onclick添加到按钮标记中,然后添加一些javascript,例如:

<button onclick="window.open('mailto:email@email.de');">Kontakt</button>

答案 4 :(得分:0)

使用<a>标记。

<a href="mailto:email@email.de" class="mail-button">Kontakt</a>

并添加css以使<a>标记像按钮一样。