如何重新编写此联系人按钮代码以使其有效?

时间:2016-03-03 16:13:05

标签: javascript html css

我的网站上有一个联系人按钮,编码如下,但是没有按照需要打开电子邮件页面。我想知道是否有人能够帮助我重新编写代码以使其正常工作。

我希望保留现有的造型和身份。基本上我不能让它悲伤地工作。



#contact-button{
	border: none;
	color: white;
	padding-top: 7px;
	padding-right: 33px;
	padding-left: 28px;
	padding-bottom: 8px;
	text-align: center;
	text-decoration: none;
	display: inline-block;
	font-style: lato;
	font-size: 20px;
	margin-top: 4px;
	margin-right: 2px;
	margin-left: 245px;
	margin-bottom: 4px;
	-webkit-transition-duration: 0.4s;
	transition-duration: 0.4s;
	cursor: pointer;
	opacity: 0.90;
	border-radius: 3px;
}

#contact-button {
    background-color: #F06000; 
    color: white; 
}

#contact-button:hover {
	color: white;
	background-color: #A74200;
}

#mail-icon{
	margin-top: 6px;
	float: left;
	margin-right: 6px;
}

<a href="mailto:#" id="contact-button">Message Me
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA3ElEQVQ4T6WTaw3CQBCEZxzgAHCAhEpAQnGAlKIAcIADQAFIQAIOhsxmr2lKQ0q7fy697Hw3+ygxMzhTD0qqAGgqyACLXwDOf0JqAEsDbgkQyd0YiKRT5q0CQLKStAfgcmqS7yGQpAWAI4A7ySa0BWCBJNsKUB+S4iuAA8lw8AXIyw2AxiCSz86dRXYXd2MAtmtHDotdVgsdBHRLSOElz22ebngzWEI20fb9SjQx60bv2+U9SB7aHuQYnVgs/5xmjtH7sy6L5MYUu2NWwTl+LPbAs58c83+myU+n8AOSyY9qfRA3mgAAAABJRU5ErkJggg==" alt="Mail Icon" id="mail-icon" />
</a> 
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:4)

只需删除mailto之前的空格:

mailto: joebloggs@gmail.com

应该是

mailto:joebloggs@gmail.com

<强>段

&#13;
&#13;
#contact-button{
	border: none;
	color: white;
	padding-top: 7px;
	padding-right: 33px;
	padding-left: 28px;
	padding-bottom: 8px;
	text-align: center;
	text-decoration: none;
	display: inline-block;
	font-style: lato;
	font-size: 20px;
	margin-top: 4px;
	margin-right: 2px;
	margin-left: 245px;
	margin-bottom: 4px;
	-webkit-transition-duration: 0.4s;
	transition-duration: 0.4s;
	cursor: pointer;
	opacity: 0.90;
	border-radius: 3px;
}

#contact-button {
    background-color: #F06000; 
    color: white; 
}

#contact-button:hover {
	color: white;
	background-color: #A74200;
}

#mail-icon{
	margin-top: 6px;
	float: left;
	margin-right: 6px;
}
&#13;
<a href="mailto:joebloggs@gmail.com" id="contact-button">Message Me
</a> 
&#13;
&#13;
&#13;

相关问题