0

我正在与我们的帮助台的员工页面会面。即使一切看起来都很好,我真的很难让联系按钮可以点击来发送电子邮件。我可以轻松地在电子邮件中添加一个可链接的选项,但这看起来很俗气。我有一种感觉,就像移动我的标签一样简单,但它似乎对我不起作用,无论我把它放在哪里,我都不是一个非常有经验的代码编写者。

<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>

4

1 回答 1

0

我建议使用 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>

于 2019-06-03T22:55:34.877 回答