我无法获得 link 发送电子邮件的按钮
I cant get a button to link to sending an email
我正在为我们的帮助台创建一个与员工见面的页面。即使一切看起来都很好,我真的很难让联系按钮可点击以发送电子邮件。我可以轻松地向电子邮件添加可链接的选项,但看起来很俗气。我感觉它就像四处移动我的标签一样简单,但它似乎对我来说不起作用,无论我把它放在哪里我都不是一个非常有经验的代码编写者。
<style type="text/css">/* Three columns side by side */
.column {
float: left;
width: 33.3%;
margin-bottom: 16px;
padding: 0 8px;
}
/* Display the columns below each other instead of side by side on small screens */
@media screen and (max-width: 650px) {
.column {
width: 100%;
display: block;
}
}
/* Add some shadows to create a card effect */
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}
/* Some left and right padding inside the container */
.container {
padding: 0 16px;
}
/* Clear floats */
.container::after, .row::after {
content: "";
clear: both;
display: table;
}
.title {
color: grey;
}
.button {
border: none;
outline: 0;
display: inline-block;
padding: 8px;
color: white;
background-color: #000;
text-align: center;
cursor: pointer;
width: 100%;
}
.button:hover {
background-color: #555;
}
</style>
<div class="row">
<div class="column">
<div class="card"><img alt="Amy" src="img1.jpg" style="width:100%" />
<div class="container">
<h2>Amy</h2>
<p class="title">IT Manager</p>
<p>Some text that describes me lorem ipsum ipsum lorem.</p>
<p><a href="mailto:amyh@.org?subject=%5B%20Spiceworks%20%5D%20-">amyh@.org</a></p>
<p><button class="button">Contact</button></p>
</div>
</div>
</div>
<div class="column">
<div class="card"><img alt="Vincent" src="https://ibb.co/N6VjMjD" style="width:100%" />
<div class="container">
<h2>Vincent</h2>
<p class="title">IT Specialist</p>
<p>Some text that describes me lorem ipsum ipsum lorem.</p>
<p><a href="mailto:vincentw@?subject=%5B%20Spiceworks%20%5D%20%-">vincentw@</a></p>
<p><button class="button">Contact</button></p>
</div>
</div>
</div>
</div>
我建议使用 CSS 来设置 <a>
元素的样式,就像设置 <button>
元素的样式一样。
像这样:
<a href="mailto..." class="button">Contact</a>
.button {
display: block;
padding: 8px;
color: white;
background-color: #000;
text-align: center;
text-decoration:none;
}
这是一个演示:
/* Three columns side by side */
.column {
float: left;
width: 33.3%;
margin-bottom: 16px;
padding: 0 8px;
}
/* Display the columns below each other instead of side by side on small screens */
@media screen and (max-width: 650px) {
.column {
width: 100%;
display: block;
}
}
/* Add some shadows to create a card effect */
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}
/* Some left and right padding inside the container */
.container {
padding: 0 16px;
}
/* Clear floats */
.container::after,
.row::after {
content: "";
clear: both;
display: table;
}
.title {
color: grey;
}
.button {
display: block;
padding: 8px;
color: white;
background-color: #000;
text-align: center;
text-decoration: none;
}
.button:hover {
background-color: #555;
}
<div class="row">
<div class="column">
<div class="card"><img alt="Amy" src="img1.jpg" style="width:100%" />
<div class="container">
<h2>Amy</h2>
<p class="title">IT Manager</p>
<p>Some text that describes me lorem ipsum ipsum lorem.</p>
<p><a href="mailto:amyh@.org?subject=%5B%20Spiceworks%20%5D%20-" class="button">Contact</a></p>
</div>
</div>
</div>
<div class="column">
<div class="card"><img alt="Vincent" src="https://ibb.co/N6VjMjD" style="width:100%" />
<div class="container">
<h2>Vincent</h2>
<p class="title">IT Specialist</p>
<p>Some text that describes me lorem ipsum ipsum lorem.</p>
<p><a href="mailto:vincentw@?subject=%5B%20Spiceworks%20%5D%20%-" class="button">Contact</a></p>
</div>
</div>
</div>
</div>
我正在为我们的帮助台创建一个与员工见面的页面。即使一切看起来都很好,我真的很难让联系按钮可点击以发送电子邮件。我可以轻松地向电子邮件添加可链接的选项,但看起来很俗气。我感觉它就像四处移动我的标签一样简单,但它似乎对我来说不起作用,无论我把它放在哪里我都不是一个非常有经验的代码编写者。
<style type="text/css">/* Three columns side by side */
.column {
float: left;
width: 33.3%;
margin-bottom: 16px;
padding: 0 8px;
}
/* Display the columns below each other instead of side by side on small screens */
@media screen and (max-width: 650px) {
.column {
width: 100%;
display: block;
}
}
/* Add some shadows to create a card effect */
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}
/* Some left and right padding inside the container */
.container {
padding: 0 16px;
}
/* Clear floats */
.container::after, .row::after {
content: "";
clear: both;
display: table;
}
.title {
color: grey;
}
.button {
border: none;
outline: 0;
display: inline-block;
padding: 8px;
color: white;
background-color: #000;
text-align: center;
cursor: pointer;
width: 100%;
}
.button:hover {
background-color: #555;
}
</style>
<div class="row">
<div class="column">
<div class="card"><img alt="Amy" src="img1.jpg" style="width:100%" />
<div class="container">
<h2>Amy</h2>
<p class="title">IT Manager</p>
<p>Some text that describes me lorem ipsum ipsum lorem.</p>
<p><a href="mailto:amyh@.org?subject=%5B%20Spiceworks%20%5D%20-">amyh@.org</a></p>
<p><button class="button">Contact</button></p>
</div>
</div>
</div>
<div class="column">
<div class="card"><img alt="Vincent" src="https://ibb.co/N6VjMjD" style="width:100%" />
<div class="container">
<h2>Vincent</h2>
<p class="title">IT Specialist</p>
<p>Some text that describes me lorem ipsum ipsum lorem.</p>
<p><a href="mailto:vincentw@?subject=%5B%20Spiceworks%20%5D%20%-">vincentw@</a></p>
<p><button class="button">Contact</button></p>
</div>
</div>
</div>
</div>
我建议使用 CSS 来设置 <a>
元素的样式,就像设置 <button>
元素的样式一样。
像这样:
<a href="mailto..." class="button">Contact</a>
.button {
display: block;
padding: 8px;
color: white;
background-color: #000;
text-align: center;
text-decoration:none;
}
这是一个演示:
/* Three columns side by side */
.column {
float: left;
width: 33.3%;
margin-bottom: 16px;
padding: 0 8px;
}
/* Display the columns below each other instead of side by side on small screens */
@media screen and (max-width: 650px) {
.column {
width: 100%;
display: block;
}
}
/* Add some shadows to create a card effect */
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}
/* Some left and right padding inside the container */
.container {
padding: 0 16px;
}
/* Clear floats */
.container::after,
.row::after {
content: "";
clear: both;
display: table;
}
.title {
color: grey;
}
.button {
display: block;
padding: 8px;
color: white;
background-color: #000;
text-align: center;
text-decoration: none;
}
.button:hover {
background-color: #555;
}
<div class="row">
<div class="column">
<div class="card"><img alt="Amy" src="img1.jpg" style="width:100%" />
<div class="container">
<h2>Amy</h2>
<p class="title">IT Manager</p>
<p>Some text that describes me lorem ipsum ipsum lorem.</p>
<p><a href="mailto:amyh@.org?subject=%5B%20Spiceworks%20%5D%20-" class="button">Contact</a></p>
</div>
</div>
</div>
<div class="column">
<div class="card"><img alt="Vincent" src="https://ibb.co/N6VjMjD" style="width:100%" />
<div class="container">
<h2>Vincent</h2>
<p class="title">IT Specialist</p>
<p>Some text that describes me lorem ipsum ipsum lorem.</p>
<p><a href="mailto:vincentw@?subject=%5B%20Spiceworks%20%5D%20%-" class="button">Contact</a></p>
</div>
</div>
</div>
</div>